diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2010-08-11 21:27:35 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2010-08-11 21:27:35 +0000 |
commit | 894f256912cca031a068b84c73eccd24d43f464c (patch) | |
tree | 2bb4e4a1756bc35f4edd36359955910d2194baa6 /epan/dissectors/packet-sdp.c | |
parent | 9969691f49226d31405e78e65c92460daae7ffb1 (diff) | |
download | wireshark-894f256912cca031a068b84c73eccd24d43f464c.tar.gz |
Added check for valid tvb before calling tvb_length().
svn path=/trunk/; revision=33774
Diffstat (limited to 'epan/dissectors/packet-sdp.c')
-rw-r--r-- | epan/dissectors/packet-sdp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c index 1826fa0ec0..82fc778c9c 100644 --- a/epan/dissectors/packet-sdp.c +++ b/epan/dissectors/packet-sdp.c @@ -1368,13 +1368,15 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset */ if (mime_type != NULL && g_ascii_strcasecmp(mime_type, "H264") == 0) { if (strcmp(field_name, "profile-level-id") == 0) { - int length; + int length = 0; /* Length includes "=" as it's required by ascii_bytes_to_tvb()*/ tokenlen = end_offset - offset; format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen); data_tvb = ascii_bytes_to_tvb(tvb, pinfo, tokenlen, format_specific_parameter); - length = tvb_length(data_tvb); + if (data_tvb) { + length = tvb_length(data_tvb); + } if (length == 3){ if(h264_handle && data_tvb){ dissect_h264_profile(data_tvb, pinfo, tree); |