aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-12-15 17:14:56 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-12-15 17:14:56 +0000
commitd3e76bdeb03af9b945e45766d8dcfc11dc0a6807 (patch)
tree8dc54ed9eb71c10860388d113ed5646ddecceabf
parent6c809fc444f8d49a4ffddb05e78ac1cd59a895e7 (diff)
Use correct string length.
svn path=/trunk/; revision=40209
-rw-r--r--epan/dissectors/packet-sgsap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-sgsap.c b/epan/dissectors/packet-sgsap.c
index 9fb49ae377..86554c4960 100644
--- a/epan/dissectors/packet-sgsap.c
+++ b/epan/dissectors/packet-sgsap.c
@@ -196,8 +196,10 @@ de_sgsap_imeisv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
imeisv_str = tvb_bcd_dig_to_ep_str( tvb, curr_offset, len, NULL, FALSE);
proto_tree_add_string(tree, hf_sgsap_imeisv, tvb, curr_offset, len, imeisv_str);
- if (add_string)
- g_snprintf(add_string, len, " - %s", imeisv_str);
+ if (add_string){
+ /* (len<<2)+4 = the maximum number of bytes to produce (including the terminating nul character). */
+ g_snprintf(add_string, (len<<2)+4, " - %s", imeisv_str);
+ }
return(len);
}