summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-05-16 17:30:00 +0000
committerJeremy Allison <jra@samba.org>2007-05-16 17:30:00 +0000
commit4b85f6a7648ae16b84947dc71f28d646d46e9c9b (patch)
tree04f24daf3949aa78ca6812266e99fc4ddf685dfc /source
parent78383cce5d5203861374c727b8b5420761771238 (diff)
downloadsamba-4b85f6a7648ae16b84947dc71f28d646d46e9c9b.tar.gz
samba-4b85f6a7648ae16b84947dc71f28d646d46e9c9b.tar.xz
samba-4b85f6a7648ae16b84947dc71f28d646d46e9c9b.zip
r22951: Merge Volkers's logic fix from r22930. Only read
the rest of the data if there is any. Jeremy.
Diffstat (limited to 'source')
-rw-r--r--source/libsmb/clientgen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c
index e5746030880..cc70c4bcd28 100644
--- a/source/libsmb/clientgen.c
+++ b/source/libsmb/clientgen.c
@@ -111,7 +111,7 @@ BOOL cli_receive_smb(struct cli_state *cli)
}
/* 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 @@ BOOL cli_receive_smb_readX_header(struct cli_state *cli)
}
/* 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;
}