aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ntlmssp.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2014-03-23 16:18:48 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-03-24 10:17:18 +0000
commit8da90a2c5a7948c401d3b5e951de6c75bfa8f40b (patch)
tree83293480b53516476765e9c30ae267ceb74716fa /epan/dissectors/packet-ntlmssp.c
parent30a4398318a3facecbaf1b6e8621e880ca5ec028 (diff)
Fix Argument with 'nonnull' attribute passed null found by Clang
Change-Id: I5c84e4813d03b734afaf2a7cb3205773324f049d Reviewed-on: https://code.wireshark.org/review/798 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ntlmssp.c')
-rw-r--r--epan/dissectors/packet-ntlmssp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index 5ae1b7cf04..1e7d154e31 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -711,7 +711,9 @@ create_ntlmssp_v1_key(const char *nt_password, const guint8 *serverchallenge, co
memcpy(nt_password_hash, pass_list[i].md4, NTLMSSP_KEY_LEN);
/*printnbyte(nt_password_hash, NTLMSSP_KEY_LEN, "Current NT password hash: ", "\n");*/
i++;
- memcpy(lm_challenge_response, clientchallenge, 8);
+ if(clientchallenge){
+ memcpy(lm_challenge_response, clientchallenge, 8);
+ }
md5_init(&md5state);
md5_append(&md5state, serverchallenge, 8);
md5_append(&md5state, clientchallenge, 8);
@@ -745,10 +747,12 @@ create_ntlmssp_v1_key(const char *nt_password, const guint8 *serverchallenge, co
* Otherwise it should be lm_password_hash ...*/
crypt_md4(md4, nt_password_hash, NTLMSSP_KEY_LEN);
if (flags & NTLMSSP_NEGOTIATE_EXTENDED_SECURITY) {
- memcpy(challenges, serverchallenge, 8);
- memcpy(challenges+8, clientchallenge, 8);
- /*md5_hmac(text, text_len, key, key_len, digest);*/
- md5_hmac(challenges, NTLMSSP_KEY_LEN, md4, NTLMSSP_KEY_LEN, sessionbasekey);
+ memcpy(challenges, serverchallenge, 8);
+ if(clientchallenge){
+ memcpy(challenges+8, clientchallenge, 8);
+ }
+ /*md5_hmac(text, text_len, key, key_len, digest);*/
+ md5_hmac(challenges, NTLMSSP_KEY_LEN, md4, NTLMSSP_KEY_LEN, sessionbasekey);
}
else {
memcpy(sessionbasekey, md4, NTLMSSP_KEY_LEN);