|
@@ -282,7 +282,7 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
|
|
byte_count = be32_to_cpu(pTargetSMB->smb_buf_length);
|
|
byte_count = be32_to_cpu(pTargetSMB->smb_buf_length);
|
|
byte_count += total_in_buf2;
|
|
byte_count += total_in_buf2;
|
|
/* don't allow buffer to overflow */
|
|
/* don't allow buffer to overflow */
|
|
- if (byte_count > CIFSMaxBufSize)
|
|
|
|
|
|
+ if (byte_count > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4)
|
|
return -ENOBUFS;
|
|
return -ENOBUFS;
|
|
pTargetSMB->smb_buf_length = cpu_to_be32(byte_count);
|
|
pTargetSMB->smb_buf_length = cpu_to_be32(byte_count);
|
|
|
|
|