diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-12-22 09:49:56 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-12-22 12:53:49 +0000 |
commit | 61d2c8f4a4fdca8f6d9055400a29f8c74580c313 (patch) | |
tree | bcb3631264a4f0b4b8e89c62818afba514829316 | |
parent | b3b23ff134adc3e997ba809f2a2e8dbb22266528 (diff) |
RTP: fix a possible NULL pointer dereference (CID 1397705 & 1397706)
As those dissectors are registered by name, let's not make the assumption
that rtp_info is always present.
Change-Id: I959b8c71485471b3be4cd2e71a6d96c2d4b278ff
Reviewed-on: https://code.wireshark.org/review/19381
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-rtp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 922866272c..63e194d5cc 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -2476,7 +2476,7 @@ static char *ed137_squ_only = "SQU"; static char *ed137_ptt_and_squ = "PTT+SQU"; static int -dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ ) +dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { unsigned int hdr_extension_len; struct _rtp_info *rtp_info=(struct _rtp_info *)data; @@ -2491,7 +2491,9 @@ dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v gboolean ed137_ptt = FALSE; gboolean ed137_squ = FALSE; - rtp_info->info_is_ed137 = TRUE; + if (rtp_info != NULL) { + rtp_info->info_is_ed137 = TRUE; + } if ( tree ) { proto_item *ti; ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, offset, hdr_extension_len * 4, ENC_NA); @@ -2590,7 +2592,7 @@ dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v } static int -dissect_rtp_hdr_ext_ed137a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ ) +dissect_rtp_hdr_ext_ed137a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { unsigned int hdr_extension_len; struct _rtp_info *rtp_info=(struct _rtp_info *)data; @@ -2605,7 +2607,9 @@ dissect_rtp_hdr_ext_ed137a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean ed137_ptt = FALSE; gboolean ed137_squ = FALSE; - rtp_info->info_is_ed137 = TRUE; + if (rtp_info != NULL) { + rtp_info->info_is_ed137 = TRUE; + } if ( tree ) { proto_item *ti; ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, offset, hdr_extension_len * 4, ENC_NA); |