diff options
author | Evan Huus <eapache@gmail.com> | 2013-10-08 21:12:06 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-10-08 21:12:06 +0000 |
commit | 69da562c83e58c9bf71775ab492219534ee459cc (patch) | |
tree | e77bf102486122449725d73d1372f9981a28a46b | |
parent | 08637912532b7c83a151d35cefe396520df8c3c8 (diff) | |
download | wireshark-69da562c83e58c9bf71775ab492219534ee459cc.tar.gz wireshark-69da562c83e58c9bf71775ab492219534ee459cc.tar.bz2 wireshark-69da562c83e58c9bf71775ab492219534ee459cc.zip |
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
-rw-r--r-- | epan/oids.c | 9 |
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++ = '.'; |