summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 328ca92727..5eb9c18b60 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -552,6 +552,10 @@ BOOL receive_smb_raw(int fd,char *buffer, unsigned int timeout)
smb_read_error = READ_ERROR;
return False;
}
+
+ /* not all of samba3 properly checks for packet-termination of strings. This
+ ensures that we don't run off into empty space. */
+ SSVAL(buffer+4,len, 0);
}
return True;