ieee80211: fix stack-use-after-return
authorPeter Wu <peter@lekensteyn.nl>
Tue, 25 Apr 2017 10:13:01 +0000 (12:13 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Tue, 25 Apr 2017 13:51:52 +0000 (13:51 +0000)
Bug: 13662
Change-Id: I26c53ecc78005b26908d74877814be22924848bc
Fixes: v1.11.3-rc1-2029-g4b8b83407a ("Support for IEEE 802.11ad")
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1268
Reviewed-on: https://code.wireshark.org/review/21333
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
epan/dissectors/packet-ieee80211.c

index 5347845f02346f6115ba12f36bf8be512a0f5c35..1c14c81cc0c34d2a098d5fd01548799b28822d2b 100644 (file)
@@ -14336,9 +14336,8 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset
   ieee80211_tagged_field_data_t field_data;
   gboolean      isDMG;
 
-  gboolean     *p_isDMG = ((gboolean*)(p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY)));
+  isDMG = GPOINTER_TO_INT(p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY));
 
-  isDMG   = p_isDMG ? *p_isDMG : FALSE;
   tag_no  = tvb_get_guint8(tvb, offset);
   tag_len = tvb_get_guint8(tvb, offset + 1);
 
@@ -17169,7 +17168,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
 
   AIRPDCAP_KEY_ITEM  used_key;
 
-  p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY, &isDMG);
+  p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY, GINT_TO_POINTER(isDMG));
 
   whdr= &whdrs[0];