aboutsummaryrefslogtreecommitdiffstats
path: root/epan/oids.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-10-08 21:12:06 +0000
committerEvan Huus <eapache@gmail.com>2013-10-08 21:12:06 +0000
commit69da562c83e58c9bf71775ab492219534ee459cc (patch)
treee77bf102486122449725d73d1372f9981a28a46b /epan/oids.c
parent08637912532b7c83a151d35cefe396520df8c3c8 (diff)
Don't try and construct an OID string if the len is zero. Fixes
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9246 svn path=/trunk/; revision=52455
Diffstat (limited to 'epan/oids.c')
-rw-r--r--epan/oids.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/oids.c b/epan/oids.c
index 61177ed0d8..a93b950e4d 100644
--- a/epan/oids.c
+++ b/epan/oids.c
@@ -832,11 +832,14 @@ const char* oid_subid2string(guint32* subids, guint len) {
return rel_oid_subid2string(subids, len, TRUE);
}
const char* rel_oid_subid2string(guint32* subids, guint len, gboolean is_absolute) {
- char* s = (char *)ep_alloc0(((len)*11)+1);
- char* w = s;
+ char *s, *w;
- if(!subids)
+ if(!subids || len == 0)
return "*** Empty OID ***";
+
+ s = (char *)ep_alloc0(((len)*11)+2);
+ w = s;
+
if (!is_absolute)
*w++ = '.';