From 3ef16b2679bed40041483b8f862463fb30f426dc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 9 Aug 2004 20:47:31 +0000 Subject: r1674: fixed a bug in the handling of STR_LEN8BIT flagged strings (This used to be commit 17a331529706266bd53b2d1c7b873cf4bbd7aaa7) --- source4/libcli/raw/rawrequest.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/libcli') diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c index 4143cb12ca..70e924a99f 100644 --- a/source4/libcli/raw/rawrequest.c +++ b/source4/libcli/raw/rawrequest.c @@ -814,12 +814,15 @@ size_t smbcli_blob_pull_string(struct smbcli_session *session, int extra; dest->s = NULL; - if (len_offset > blob->length-4) { - return 0; - } if (flags & STR_LEN8BIT) { + if (len_offset > blob->length-1) { + return 0; + } dest->private_length = CVAL(blob->data, len_offset); } else { + if (len_offset > blob->length-4) { + return 0; + } dest->private_length = IVAL(blob->data, len_offset); } extra = 0; -- cgit