summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-q931.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-01-28 18:16:22 +0000
committerGuy Harris <guy@alum.mit.edu>2009-01-28 18:16:22 +0000
commitd160db2cfba8ad616e99d2f2717b48fc5964c00f (patch)
tree61969dad45292844b102cb1da4deca478cc4c95f /epan/dissectors/packet-q931.c
parent9896da49b9cf0869e9fdc891c932f54d37d8a7e9 (diff)
downloadwireshark-d160db2cfba8ad616e99d2f2717b48fc5964c00f.tar.gz
Check the length in dissect_q931_change_status_ie().
Don't print a string value returned by a function by using it as the format string - use "%s" as the format. svn path=/trunk/; revision=27320
Diffstat (limited to 'epan/dissectors/packet-q931.c')
-rw-r--r--epan/dissectors/packet-q931.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index 5f075913f2..2156e501ef 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -1411,12 +1411,14 @@ dissect_q931_change_status_ie(tvbuff_t *tvb, int offset, int len, proto_tree *tr
{
guint8 octet;
+ if (len == 0)
+ return;
octet = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_q931_extension_ind, tvb, offset, 1, FALSE);
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1, "%s",
decode_enumerated_bitfield_shifted(octet, 0x40, 8, VALS(q931_status_preference_vals), "Preference: %s"));
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1, "%s",
decode_enumerated_bitfield(octet, 0x07, 8, VALS(q931_new_status_vals), "New status: %s"));
}
@@ -2880,7 +2882,9 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree,
case CS0 | Q931_IE_CHANGE_STATUS:
if (q931_tree != NULL) {
- dissect_q931_change_status_ie(tvb, offset + 2, info_element_len, ie_tree);
+ dissect_q931_change_status_ie(tvb,
+ offset + 2, info_element_len,
+ ie_tree);
}
break;