torture: Fix a buffer overrun
authorVolker Lendecke <vl@samba.org>
Fri, 28 Feb 2014 15:50:21 +0000 (15:50 +0000)
committerDavid Disseldorp <ddiss@samba.org>
Fri, 28 Feb 2014 16:49:01 +0000 (17:49 +0100)
In test_EnumPrinterDrivers we go up to driver level 8. In C, this means
we are accessing the 9th entry in the following lines:

        ctx->driver_count[level]        = count;
        ctx->drivers[level]             = info;

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source4/torture/rpc/spoolss.c

index 135eb3cb76030643a7c53b9456036a7089f5f74f..b61efa43ddc534b36658c9dd9465d13f36cbf5f6 100644 (file)
@@ -77,8 +77,8 @@ struct test_spoolss_context {
        union spoolss_PortInfo *ports[3];
 
        /* for EnumPrinterDrivers */
-       uint32_t driver_count[8];
-       union spoolss_DriverInfo *drivers[8];
+       uint32_t driver_count[9];
+       union spoolss_DriverInfo *drivers[9];
 
        /* for EnumMonitors */
        uint32_t monitor_count[3];