diff options
author | Volker Lendecke <vl@samba.org> | 2009-03-24 21:57:01 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-03-24 22:00:10 +0100 |
commit | c653e8daaf3e842544d7f9561557d1ab9449971c (patch) | |
tree | 8298b874d13cd17b37dbb6e0a43c9c1041714046 /source3 | |
parent | 2bc9ffa9fb5c69416b00f46a59b59e0f523634d1 (diff) | |
download | samba-c653e8daaf3e842544d7f9561557d1ab9449971c.tar.gz samba-c653e8daaf3e842544d7f9561557d1ab9449971c.tar.bz2 samba-c653e8daaf3e842544d7f9561557d1ab9449971c.zip |
Fix two memleaks in the encryption code
ntlmssp_seal_packet creates its own signature data blob, which we then
have to free.
Jeremy, please check and merge appropriately (Yes, I'm asking you to do the
janitor work, I want you to *look* at this :-))
Volker
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/smb_seal.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/libsmb/smb_seal.c b/source3/libsmb/smb_seal.c index 795c8bc14c..2f7305c5b6 100644 --- a/source3/libsmb/smb_seal.c +++ b/source3/libsmb/smb_seal.c @@ -136,7 +136,7 @@ NTSTATUS common_ntlm_encrypt_buffer(NTLMSSP_STATE *ntlmssp_state, smb_set_enclen(buf_out, smb_len(buf) + NTLMSSP_SIG_SIZE, enc_ctx_num); - sig = data_blob(NULL, NTLMSSP_SIG_SIZE); + ZERO_STRUCT(sig); status = ntlmssp_seal_packet(ntlmssp_state, (unsigned char *)buf_out + 8 + NTLMSSP_SIG_SIZE, /* 4 byte len + 0xFF 'S' <enc> <ctx> */ @@ -153,6 +153,7 @@ NTSTATUS common_ntlm_encrypt_buffer(NTLMSSP_STATE *ntlmssp_state, /* First 16 data bytes are signature for SSPI compatibility. */ memcpy(buf_out + 8, sig.data, NTLMSSP_SIG_SIZE); + data_blob_free(&sig); *ppbuf_out = buf_out; return NT_STATUS_OK; } |