diff options
author | Günther Deschner <gd@samba.org> | 2011-01-19 00:15:09 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-01-21 10:58:20 +0100 |
commit | bb51c050149c2e2ea5bf81f283da862fc1e840d2 (patch) | |
tree | 2352f6d3aaad7d275d2cd5889247868483b13b80 | |
parent | 57809400923822993762550ad56db86a078eae5e (diff) | |
download | samba-bb51c050149c2e2ea5bf81f283da862fc1e840d2.tar.gz samba-bb51c050149c2e2ea5bf81f283da862fc1e840d2.tar.bz2 samba-bb51c050149c2e2ea5bf81f283da862fc1e840d2.zip |
s4-smbtorture: add some paranoia checks for 0 sized devmodes.
Guenther
-rw-r--r-- | source4/torture/rpc/spoolss.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 2dd7164338..3536b82b50 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -2239,10 +2239,20 @@ static bool test_PrinterInfo_DevModes(struct torture_context *tctx, devmode = info.info8.devmode; + if (devmode && devmode->size == 0) { + torture_fail(tctx, + "devmode of zero size!"); + } + torture_assert(tctx, test_GetPrinter_level(tctx, b, handle, 2, &info), ""); devmode2 = info.info2.devmode; + if (devmode2 && devmode2->size == 0) { + torture_fail(tctx, + "devmode of zero size!"); + } + torture_assert(tctx, test_devicemode_equal(tctx, devmode, devmode2), "DM level 8 != DM level 2"); @@ -2384,6 +2394,11 @@ static bool test_PrinterInfo_DevMode(struct torture_context *tctx, devmode = info.info8.devmode; + if (devmode && devmode->size == 0) { + torture_fail(tctx, + "devmode of zero size!"); + } + if (addprinter_devmode) { if (!test_devicemode_equal(tctx, devmode, addprinter_devmode)) { torture_warning(tctx, "current global DM is != DM provided in addprinter"); |