This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
}
/* 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);
}
/* 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;
}