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:
parent
3656cb2e57
commit
ac4a77ccca
@ -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)
|
||||
{
|
||||
uint16_t enc_ctx_num;
|
||||
|
||||
if (!common_encryption_on(es)) {
|
||||
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) {
|
||||
SAFE_FREE(buf);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user