From f38fc7b3b1ded90c2562bdfc9aaa7a026ec1e56a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 23 Aug 2002 15:01:07 +0000 Subject: We never checked if the smb packet len is != 0 Should fix a supposed DoS too. (This used to be commit f76e5b2677beb161c2f9c0d3dd78e707655e942f) --- source3/lib/util_sock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/lib') 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 -- cgit