1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

Fix for crash bug freeing a non-malloc'ed buffer if the client sends a non-encrypted packet with the crypto state set.

This commit is contained in:
Volker Lendecke 2008-12-05 13:20:55 -08:00 committed by Jeremy Allison
parent 3656cb2e57
commit ac4a77ccca

View File

@ -388,10 +388,17 @@ void common_free_encryption_state(struct smb_trans_enc_state **pp_es)
void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf) void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf)
{ {
uint16_t enc_ctx_num;
if (!common_encryption_on(es)) { if (!common_encryption_on(es)) {
return; return;
} }
if (!NT_STATUS_IS_OK(get_enc_ctx_num((const uint8_t *)buf,
&enc_ctx_num))) {
return;
}
if (es->smb_enc_type == SMB_TRANS_ENC_NTLM) { if (es->smb_enc_type == SMB_TRANS_ENC_NTLM) {
SAFE_FREE(buf); SAFE_FREE(buf);
return; return;