libcli/smb: let smb2_negotiate_context_parse() only parse the expected number of...
commit147dd9d58a429695a3b6c6e45c8b0eaafc67908a
authorStefan Metzmacher <metze@samba.org>
Sun, 9 May 2021 19:16:00 +0000 (9 21:16 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 12 Jul 2021 21:25:21 +0000 (12 21:25 +0000)
treec673cacc4e69501d32d274cf346097d412cf1373
parent44aba9c7cabedf7b5a01fb9c5f3099125dd70602
libcli/smb: let smb2_negotiate_context_parse() only parse the expected number of contexts

Any garbage at the end needs to be ignored.

This fixes the Negotiate_SMB311_ContextID_NetName test from:
https://github.com/microsoft/WindowsProtocolTestSuites/blob/main/TestSuites/FileServer/src/SMB2/TestSuite/Negotiate/Negotiation.cs#L730

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul 12 21:25:21 UTC 2021 on sn-devel-184
libcli/smb/smb2_negotiate_context.c
libcli/smb/smb2_negotiate_context.h
libcli/smb/smbXcli_base.c
source3/smbd/smb2_negprot.c