Fix bug #7698 - Assert causes smbd to panic on invalid NetBIOS session request.
commitb1f637924f3470346d01a3359743aa00ba48a63e
authorJeremy Allison <jra@samba.org>
Sun, 26 Sep 2010 11:49:29 +0000 (26 04:49 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 6 Oct 2010 19:17:37 +0000 (6 21:17 +0200)
treea8cf8a15ea61a2e465a58a3b32f5bbcb5a088f32
parentafc0d4a267da57c19b43d819e8166bfdc5cb3ec2
Fix bug #7698 - Assert causes smbd to panic on invalid NetBIOS session request.

Found by the CodeNomicon test suites at the SNIA plugfest.

http://www.codenomicon.com/

If an invalid NetBIOS session request is received the code in name_len() in
libsmb/nmblib.c can hit an assert.

Re-write name_len() and name_extract() to use "buf/len" pairs and
always limit reads.

(Modified for 3.5.x)

Jeremy.
(cherry picked from commit 08bb0fb61580cf528109ebd061a91e4fa5be5a2b)
source3/include/proto.h
source3/libsmb/cliconnect.c
source3/libsmb/nmblib.c
source3/smbd/process.c
source3/smbd/reply.c
source3/utils/smbfilter.c