summaryrefslogtreecommitdiffstats
path: root/source/lib/util_sock.c
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
commitf76e5b2677beb161c2f9c0d3dd78e707655e942f (patch)
treeef597bb58f7ad889063424d188f70e6d22408ff0 /source/lib/util_sock.c
parentb8dba26978c281259e02b9d6ebacaa7cba4f7787 (diff)
downloadsamba-f76e5b2677beb161c2f9c0d3dd78e707655e942f.tar.gz
samba-f76e5b2677beb161c2f9c0d3dd78e707655e942f.tar.xz
samba-f76e5b2677beb161c2f9c0d3dd78e707655e942f.zip
We never checked if the smb packet len is != 0
Should fix a supposed DoS too.
Diffstat (limited to 'source/lib/util_sock.c')
-rw-r--r--source/lib/util_sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c
index 56ef4a6ab1c..03c780f8bfc 100644
--- a/source/lib/util_sock.c
+++ b/source/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