WireGuard: fix null-deref in wg_dissect_handshake_initiation

session can be NULL if no valid session was found in the first pass.
Reproduced crash with attachment 16534 from bug 15050.

Change-Id: I45b9fcc4bfeb79b00075f70417acb17c2e4aede2
Fixes: v2.9.0rc0-1389-g5b61737dc9 ("WireGuard: implement initiation message decryption with static keys")
Reviewed-on: https://code.wireshark.org/review/29047
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Peter Wu 2018-08-09 18:14:57 +02:00 committed by Alexis La Goutte
parent bc6e462c23
commit 3d9534d0ee
1 changed files with 1 additions and 1 deletions

View File

@ -1344,7 +1344,7 @@ wg_dissect_handshake_initiation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *w
wg_process_initiation(tvb, hs);
}
}
} else {
} else if (wg_pinfo->session) {
hs = wg_pinfo->session->hs;
}
#endif /* WG_DECRYPTION_SUPPORTED */