summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-07-14 05:13:30 +0000
committerTim Potter <tpot@samba.org>2003-07-14 05:13:30 +0000
commit9e51951e6e4e5c1fcf89e37123f59c08df56e09e (patch)
tree4cd7c1d74d894db73815f0168c4fa231cd8de282
parent31e6ed17a34dd922355bfe515909290947e87c54 (diff)
downloadsamba-9e51951e6e4e5c1fcf89e37123f59c08df56e09e.tar.gz
samba-9e51951e6e4e5c1fcf89e37123f59c08df56e09e.tar.bz2
samba-9e51951e6e4e5c1fcf89e37123f59c08df56e09e.zip
Don't bomb out when trying to unmarshall a zero length printerdata value.
Fixes remote printer publishing of shared printers from a Samba server. (This used to be commit 7f363fa32d3b660567fc87d5d0b1e1d4dd58461a)
-rw-r--r--source3/rpc_parse/parse_spoolss.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 03b204e69d..1a380c64d5 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -7296,15 +7296,14 @@ static BOOL spoolss_io_printer_enum_values_ctr(const char *desc, prs_struct *ps,
if (!prs_unistr("valuename", ps, depth, &ctr->values[i].valuename))
return False;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && ctr->values[i].data_len) {
ctr->values[i].data = (uint8 *)prs_alloc_mem(
ps, ctr->values[i].data_len);
if (!ctr->values[i].data)
return False;
+ if (!prs_uint8s(False, "data", ps, depth, ctr->values[i].data, ctr->values[i].data_len))
+ return False;
}
-
- if (!prs_uint8s(False, "data", ps, depth, ctr->values[i].data, ctr->values[i].data_len))
- return False;
if ( !prs_align_uint16(ps) )
return False;