summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-08-13 19:57:19 +0200
committerVolker Lendecke <vl@samba.org>2008-08-23 15:12:39 +0200
commit56cd17dfe145c2df2b39ad295136c4922bee8e43 (patch)
tree17caf1dc4db2fef84b537dbea06c53e80686b413
parentd7d3b37d566785234f383c2f0538b92798f49e9e (diff)
downloadsamba-56cd17dfe145c2df2b39ad295136c4922bee8e43.tar.gz
samba-56cd17dfe145c2df2b39ad295136c4922bee8e43.tar.bz2
samba-56cd17dfe145c2df2b39ad295136c4922bee8e43.zip
Protect against short read&x replies
(This used to be commit 4ed73cbbbeff4b554cc8d28252b756241396b3a1)
-rw-r--r--source3/libsmb/clireadwrite.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index a57f1e0785..4d3027694f 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -138,6 +138,10 @@ NTSTATUS cli_read_andx_recv(struct async_req *req, ssize_t *received,
return status;
}
+ if (wct < 12) {
+ return NT_STATUS_INVALID_NETWORK_RESPONSE;
+ }
+
/* size is the number of bytes the server returned.
* Might be zero. */
size = SVAL(cli_req->inbuf, smb_vwv5);