summaryrefslogtreecommitdiffstats
path: root/source3/libsmb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clientgen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 92a9678de56..ef74de9f4ba 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -260,7 +260,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;
}