diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-28 22:50:30 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-28 22:50:30 +0000 |
commit | 2d066492d547ec69c4ff62b98e502dd0c2938017 (patch) | |
tree | e87a215ea88d809891a9c10eb0db115931b1146b | |
parent | 4a0635cd6df183b0093a672616065fb44cdd2e0c (diff) | |
download | samba-2d066492d547ec69c4ff62b98e502dd0c2938017.tar.gz samba-2d066492d547ec69c4ff62b98e502dd0c2938017.tar.bz2 samba-2d066492d547ec69c4ff62b98e502dd0c2938017.zip |
fixed a couple of bugs in the driver return code
(This used to be commit 8695cb0023597fd118241a431eeeddc559484465)
-rw-r--r-- | source3/printing/nt_printing.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 57c65e5eca..54212f6c21 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])); } |