From f8f1679bc46a99462daf4336be5155db37482361 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 12 Sep 2008 21:19:37 +0200 Subject: Add a paranoia check on incoming PDUs (This used to be commit 8b81b85200b7ca18cf81fdbbc3254d8578b35f43) --- source3/libsmb/async_smb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index eedc7d4481..b4d93ff968 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -759,6 +759,13 @@ static void handle_incoming_pdu(struct cli_state *cli) } + if ((IVAL(pdu, 4) != 0x424d53ff) /* 0xFF"SMB" */ + && (IVAL(pdu, 4) != 0x424d45ff)) /* 0xFF"EMB" */ { + DEBUG(10, ("Got non-SMB PDU\n")); + status = NT_STATUS_INVALID_NETWORK_RESPONSE; + goto invalidate_requests; + } + /* * TODO: Handle oplock break requests */ -- cgit