1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00

handle errors from receive_smb better, and print error string

This commit is contained in:
Andrew Tridgell
-
parent 654c242045
commit 7814eca4b2
2 changed files with 9 additions and 9 deletions

View File

@@ -2683,12 +2683,11 @@ BOOL receive_smb(int fd,char *buffer,int timeout)
if (len == -1)
return(False);
if (len > BUFFER_SIZE)
{
DEBUG(0,("Invalid packet length! (%d bytes)\n",len));
if (len > BUFFER_SIZE + (SAFETY_MARGIN/2))
exit(1);
}
if (len > BUFFER_SIZE) {
DEBUG(0,("Invalid packet length! (%d bytes)\n",len));
if (len > BUFFER_SIZE + (SAFETY_MARGIN/2))
exit(1);
}
ok = (read_data(fd,buffer+4,len) == len);