torture: Fix array access in spoolss test.
authorAndreas Schneider <asn@samba.org>
Tue, 19 Feb 2013 08:32:30 +0000 (09:32 +0100)
committerAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 15:36:13 +0000 (16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source4/torture/rpc/spoolss.c

index f08e93bfaa52861d54d1be128c64d7cce916caeb..7d9ae9946592ccc1f86835f3b83c6d4177e7fccc 100644 (file)
@@ -679,8 +679,8 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
        for (i=0;i<ARRAY_SIZE(levels);i++) {
                int level = levels[i];
 
-               for (j=0;j<ctx->driver_count[level];j++) {
-                       union spoolss_DriverInfo *cur = &ctx->drivers[level][j];
+               for (j=0;j<ctx->driver_count[level - 1];j++) {
+                       union spoolss_DriverInfo *cur = &ctx->drivers[level - 1][j];
                        union spoolss_DriverInfo *ref = &ctx->drivers[8][j];
 
                        switch (level) {