Skip to content

Commit

Permalink
librpc: Check for NULL pointer in value() in ntlmssp_AUTHENTICATE
Browse files Browse the repository at this point in the history
This allows ndrdump --validate to avoid following a NULL pointer when re-pushing
a valid but unusual input.

It also avoids an issue if the Samba server code were to provide a response
without an EncryptedRandomSessionKey.

At this stage ntlmssp.idl is not used for this, instead the packets are
generated with msrpc_gen().

Found by Douglas Bagnall using Hongfuzz and the new fuzz_ndr_X
fuzzer.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Nov 20 06:06:29 UTC 2019 on sn-devel-184
  • Loading branch information
abartlet committed Nov 20, 2019
1 parent 33e9021 commit f7f9280
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion librpc/idl/ntlmssp.idl
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ interface ntlmssp
[value(ndr_ntlmssp_string_length(NegotiateFlags, Workstation))] uint16 WorkstationLen;
[value(WorkstationLen)] uint16 WorkstationMaxLen;
[relative] [subcontext(0),subcontext_size(WorkstationLen)] [flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] string *Workstation;
[value(EncryptedRandomSessionKey->length)] uint16 EncryptedRandomSessionKeyLen;
[value(EncryptedRandomSessionKey == NULL ? 0 : EncryptedRandomSessionKey->length)] uint16 EncryptedRandomSessionKeyLen;
[value(EncryptedRandomSessionKeyLen)] uint16 EncryptedRandomSessionKeyMaxLen;
[relative] [subcontext(0),subcontext_size(EncryptedRandomSessionKeyLen)] DATA_BLOB *EncryptedRandomSessionKey;
NEGOTIATE NegotiateFlags;
Expand Down
1 change: 0 additions & 1 deletion selftest/knownfail.d/ndrdump-NTLMSSP

This file was deleted.

0 comments on commit f7f9280

Please sign in to comment.