summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/trans2.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index acaabeea54..33aa3d0036 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -7018,16 +7018,27 @@ int reply_trans2(connection_struct *conn, char *inbuf,char *outbuf,
int size, int bufsize)
{
int outsize = 0;
- unsigned int dsoff = SVAL(inbuf, smb_dsoff);
- unsigned int dscnt = SVAL(inbuf, smb_dscnt);
- unsigned int psoff = SVAL(inbuf, smb_psoff);
- unsigned int pscnt = SVAL(inbuf, smb_pscnt);
- unsigned int tran_call = SVAL(inbuf, smb_setup0);
+ unsigned int dsoff;
+ unsigned int dscnt;
+ unsigned int psoff;
+ unsigned int pscnt;
+ unsigned int tran_call;
struct trans_state *state;
NTSTATUS result;
START_PROFILE(SMBtrans2);
+ if (SVAL(inbuf, smb_wct) < 8) {
+ END_PROFILE(SMBtrans2);
+ return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+ }
+
+ dsoff = SVAL(inbuf, smb_dsoff);
+ dscnt = SVAL(inbuf, smb_dscnt);
+ psoff = SVAL(inbuf, smb_psoff);
+ pscnt = SVAL(inbuf, smb_pscnt);
+ tran_call = SVAL(inbuf, smb_setup0);
+
result = allow_new_trans(conn->pending_trans, SVAL(inbuf, smb_mid));
if (!NT_STATUS_IS_OK(result)) {
DEBUG(2, ("Got invalid trans2 request: %s\n",
@@ -7198,6 +7209,11 @@ int reply_transs2(connection_struct *conn,
START_PROFILE(SMBtranss2);
+ if (SVAL(inbuf, smb_wct) < 8) {
+ END_PROFILE(SMBtranss2);
+ return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+ }
+
show_msg(inbuf);
for (state = conn->pending_trans; state != NULL;