From a738f5b846598fa3f44a7c6aa8019ef886bd1bb7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Sep 2010 18:21:46 -0700 Subject: [PATCH] Small tweak to bugfix for 7698 - Assert causes smbd to panic on invalid NetBIOS session request. Don't just fail to reply on a bad NBT name, just don't do the internal action. Jeremy. --- source3/smbd/reply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index abff317d523..f8c016b7f91 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -522,12 +522,12 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf, size_t inb name_len1 = name_len((unsigned char *)(inbuf+4),inbuf_size - 4); if (name_len1 <= 0 || name_len1 > inbuf_size - 4) { DEBUG(0,("Invalid name length in session request\n")); - return; + break; } name_len2 = name_len((unsigned char *)(inbuf+4+name_len1),inbuf_size - 4 - name_len1); if (name_len2 <= 0 || name_len2 > inbuf_size - 4 - name_len1) { DEBUG(0,("Invalid name length in session request\n")); - return; + break; } name_type1 = name_extract((unsigned char *)inbuf, @@ -537,7 +537,7 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf, size_t inb if (name_type1 == -1 || name_type2 == -1) { DEBUG(0,("Invalid name type in session request\n")); - return; + break; } DEBUG(2,("netbios connect: name1=%s0x%x name2=%s0x%x\n", -- 2.11.4.GIT