From fa6e21e9393f814f9656460aeaa288dc543d6cec Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 21 Apr 2015 18:12:58 +0200 Subject: dissectors: 80211_mac_hdr: Check return value of pkt_pull Prevent a NULL pointer dereference if (for whatever reason) pkt_pull returns NULL. This issue was discovered using the Coverity scanner. Fixes: 9278bb65 ("netsniff-ng: Dump basic radiotap header info") Signed-off-by: Tobias Klauser --- proto_80211_mac_hdr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proto_80211_mac_hdr.c b/proto_80211_mac_hdr.c index 0705eec..199c4e7 100644 --- a/proto_80211_mac_hdr.c +++ b/proto_80211_mac_hdr.c @@ -3154,6 +3154,8 @@ static void ieee80211(struct pkt_buff *pkt) rtap = (struct ieee80211_radiotap_header *)pkt_pull(pkt, sizeof(*rtap)); + if (rtap == NULL) + return; tprintf(" [ Radiotap "); tprintf("Version (%u), ", rtap->version); -- cgit v1.2.3-54-g00ecf