summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-10-06 17:40:58 +0200
committerVolker Lendecke <vlendec@samba.org>2010-10-08 07:40:51 +0000
commit7915142848f07b477f2c26d0034a79840757b8af (patch)
treeaca8654801206f5773cc61f27a37184c3877a820
parentcd04af78d51121cc16453fcd52e0d4c3516bc3c5 (diff)
downloadsamba-7915142848f07b477f2c26d0034a79840757b8af.tar.gz
samba-7915142848f07b477f2c26d0034a79840757b8af.tar.bz2
samba-7915142848f07b477f2c26d0034a79840757b8af.zip
s3: Fix input check in is_encrypted_packet
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Oct 8 07:40:52 UTC 2010 on sn-devel-104
-rw-r--r--source3/smbd/seal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c
index 0cf730ee4f..1d8d4641e7 100644
--- a/source3/smbd/seal.c
+++ b/source3/smbd/seal.c
@@ -55,7 +55,9 @@ bool is_encrypted_packet(const uint8_t *inbuf)
uint16_t enc_num;
/* Ignore non-session messages or non 0xFF'E' messages. */
- if(CVAL(inbuf,0) || !(inbuf[4] == 0xFF && inbuf[5] == 'E')) {
+ if(CVAL(inbuf,0)
+ || (smb_len(inbuf) < 8)
+ || !(inbuf[4] == 0xFF && inbuf[5] == 'E')) {
return false;
}