From c123c8454142d17d2884ae9dd951b7f2a0b1a343 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Nov 2003 02:08:41 +0000 Subject: fixed some memory leaks in the dcerpc use of ntlmssp signing (This used to be commit abbc9993b8f7eb9f57e079db1d0b170d0b9aa443) --- source4/libcli/auth/ntlmssp_sign.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/libcli/auth/ntlmssp_sign.c') diff --git a/source4/libcli/auth/ntlmssp_sign.c b/source4/libcli/auth/ntlmssp_sign.c index 11d63ec5f3..2f510b0f98 100644 --- a/source4/libcli/auth/ntlmssp_sign.c +++ b/source4/libcli/auth/ntlmssp_sign.c @@ -180,8 +180,10 @@ NTSTATUS ntlmssp_check_packet(NTLMSSP_STATE *ntlmssp_state, DEBUG(0, ("NTLMSSP packet check failed with %s\n", nt_errstr(nt_status))); return nt_status; } - - if (memcmp(sig->data+sig->length - 8, local_sig.data+local_sig.length - 8, 8) != 0) { + + if (local_sig.length != sig->length || + memcmp(local_sig.data + local_sig.length - 8, + sig->data + sig->length - 8, 8) != 0) { DEBUG(5, ("BAD SIG: wanted signature of\n")); dump_data(5, (const char *)local_sig.data, local_sig.length); @@ -192,6 +194,8 @@ NTSTATUS ntlmssp_check_packet(NTLMSSP_STATE *ntlmssp_state, return NT_STATUS_ACCESS_DENIED; } + data_blob_free(&local_sig); + /* increment counter on recieive */ ntlmssp_state->ntlmssp_seq_num++; -- cgit