From 2d066492d547ec69c4ff62b98e502dd0c2938017 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 28 May 2000 22:50:30 +0000 Subject: [PATCH] fixed a couple of bugs in the driver return code (This used to be commit 8695cb0023597fd118241a431eeeddc559484465) --- source3/printing/nt_printing.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 57c65e5eca6..54212f6c211 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -414,6 +414,13 @@ static uint32 get_a_printer_driver_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 **info_ptr, fstrcpy(driver.dependentfiles[i], ""); free(dbuf.dptr); + + if (len != dbuf.dsize) { + return 1; + } + + *info_ptr = (NT_PRINTER_DRIVER_INFO_LEVEL_3 *)memdup(&driver, sizeof(driver)); + return 0; } @@ -447,7 +454,8 @@ static uint32 dump_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 DEBUGADD(106,("monitorname:[%s]\n", info3->monitorname)); DEBUGADD(106,("defaultdatatype:[%s]\n", info3->defaultdatatype)); - for (i=0; *info3->dependentfiles[i]; i++) { + for (i=0; info3->dependentfiles && + *info3->dependentfiles[i]; i++) { DEBUGADD(106,("dependentfile:[%s]\n", info3->dependentfiles[i])); } -- 2.34.1