Author: jra
Date: 2007-05-16 17:30:00 +0000 (Wed, 16 May 2007)
New Revision: 22951

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22951

Log:
Merge Volkers's logic fix from r22930. Only read
the rest of the data if there is any.
Jeremy.

Modified:
   branches/SAMBA_3_0_26/source/libsmb/clientgen.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/libsmb/clientgen.c
===================================================================
--- branches/SAMBA_3_0_26/source/libsmb/clientgen.c     2007-05-16 17:17:25 UTC 
(rev 22950)
+++ branches/SAMBA_3_0_26/source/libsmb/clientgen.c     2007-05-16 17:30:00 UTC 
(rev 22951)
@@ -111,7 +111,7 @@
        }
 
        /* If the server is not responding, note that now */
-       if (len <= 0) {
+       if (len < 0) {
                 DEBUG(0, ("Receiving SMB: Server stopped responding\n"));
                cli->smb_rw_error = smb_read_error;
                close(cli->fd);
@@ -192,7 +192,8 @@
                        }
 
                        /* Read the rest of the data. */
-                       if (!cli_receive_smb_data(cli,cli->inbuf+len,total_len 
- len)) {
+                       if ((total_len - len > 0) &&
+                           !cli_receive_smb_data(cli,cli->inbuf+len,total_len 
- len)) {
                                goto read_err;
                        }
 

Reply via email to