summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-08-23 15:01:07 +0000
committerSimo Sorce <idra@samba.org>2002-08-23 15:01:07 +0000
commitf38fc7b3b1ded90c2562bdfc9aaa7a026ec1e56a (patch)
treefc05dafa708689bb3884abe19a0ccb4f509bb0c7 /source3/lib
parent55315b4b4e0f25ab9d77228219b8a4f8ceee6b29 (diff)
downloadsamba-f38fc7b3b1ded90c2562bdfc9aaa7a026ec1e56a.tar.gz
samba-f38fc7b3b1ded90c2562bdfc9aaa7a026ec1e56a.tar.bz2
samba-f38fc7b3b1ded90c2562bdfc9aaa7a026ec1e56a.zip
We never checked if the smb packet len is != 0
Should fix a supposed DoS too. (This used to be commit f76e5b2677beb161c2f9c0d3dd78e707655e942f)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 56ef4a6ab1..03c780f8bf 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -585,8 +585,8 @@ BOOL receive_smb(int fd,char *buffer, unsigned int timeout)
memset(buffer,'\0',smb_size + 100);
len = read_smb_length_return_keepalive(fd,buffer,timeout);
- if (len < 0) {
- DEBUG(10,("receive_smb: length < 0!\n"));
+ if (len < 0 || len == 0) {
+ DEBUG(10,("receive_smb: length < 0 or == 0!\n"));
/*
* Correct fix. smb_read_error may have already been