diff options
author | Tim Potter <tpot@samba.org> | 2002-10-17 06:39:44 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-10-17 06:39:44 +0000 |
commit | b1aba7b03b1df1dad779c21445a74b56696efdc0 (patch) | |
tree | 0d161b0bcfdf3be75aedc21d32918401cef94975 /source3/rpc_parse | |
parent | 2d51ada52725fda7255558608140fb3ba1794b84 (diff) | |
download | samba-b1aba7b03b1df1dad779c21445a74b56696efdc0.tar.gz samba-b1aba7b03b1df1dad779c21445a74b56696efdc0.tar.bz2 samba-b1aba7b03b1df1dad779c21445a74b56696efdc0.zip |
When unmarshalling a relstr, don't unmarshall the string data if the
offset is zero. Previously we were jumping to the start of the
parse buffer (i.e offset zero) and reading string data until we hit
a terminating NULL.
Test case: in a PRINTER_INFO_0 structure, the servername field may be
NULL when doing an enumprinters with flags = PRINTER_ENUM_LOCAL.
(This used to be commit e62c6bf066c2242aae605ba707c9775b37bcaca3)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 783dd97ebf..32f0c3a369 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -2097,6 +2097,9 @@ static BOOL smb_io_relstr(char *desc, NEW_BUFFER *buffer, int depth, UNISTR *str if (!prs_uint32("offset", ps, depth, &(buffer->string_at_end))) return False; + if (buffer->string_at_end == 0) + return True; + old_offset = prs_offset(ps); if(!prs_set_offset(ps, buffer->string_at_end+buffer->struct_start)) return False; |