From b0a219686bfd1a247311ed3b32d1a4b393a8de98 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 21 Dec 2000 23:38:47 +0000 Subject: merge from appliance head (This used to be commit 393c5f14e0858dcb3d6cb26eb5643b520c2c9686) --- source3/printing/nt_printing.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3') diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index c7781c6510..91679235cd 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2067,6 +2067,11 @@ static int unpack_devicemode(NT_DEVICEMODE **nt_devmode, char *buf, int buflen) */ len += tdb_unpack(buf+len, buflen-len, "B", &extra_len, &devmode.private); devmode.driverextra=(uint16)extra_len; + + /* check to catch an invalid TDB entry so we don't segfault */ + if (devmode.driverextra == 0) { + devmode.private = NULL; + } } *nt_devmode = (NT_DEVICEMODE *)memdup(&devmode, sizeof(devmode)); -- cgit