aboutsummaryrefslogtreecommitdiffstats
path: root/packet-pres.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-03-13 09:27:38 +0000
committerGuy Harris <guy@alum.mit.edu>2004-03-13 09:27:38 +0000
commited42d0931bd1150df8b61b07a482d8f9293e04d0 (patch)
treea7731461d3a25f69c0939b4d886927dec9722376 /packet-pres.c
parent6687b152f149513c8ab7e679da3f3b95913ff1e6 (diff)
From Yuriy Sidelnikov: handle the case where a presentation selector
exists but has a length of zero. svn path=/trunk/; revision=10366
Diffstat (limited to 'packet-pres.c')
-rw-r--r--packet-pres.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/packet-pres.c b/packet-pres.c
index b4b5e04bab..7151c48baa 100644
--- a/packet-pres.c
+++ b/packet-pres.c
@@ -2,7 +2,7 @@
*
* Routine to dissect ISO 8823 OSI Presentation Protocol packets
*
-* $Id: packet-pres.c,v 1.2 2004/01/23 09:53:18 guy Exp $
+* $Id: packet-pres.c,v 1.3 2004/03/13 09:27:38 guy Exp $
*
* Yuriy Sidelnikov <YSidelnikov@hotmail.com>
*
@@ -1182,10 +1182,19 @@ item_len+(asn->offset-*offset),
*offset+(asn->offset-*offset), item_len);
if(ret == ASN1_ERR_NOERROR)
{
- proto_tree_add_text(pres_tree_ms, tvb, *offset+2, item_len,
- "String:%s",s);
+ if( item_len)
+ {
+ proto_tree_add_text(pres_tree_ms, tvb, *offset+2, item_len,
+ "String:%s",s);
+ g_free(s);
+ }
+ else
+ {
+ proto_tree_add_text(pres_tree_ms, tvb, *offset+2, item_len,
+ "Zero selector length");
+
+ }
}
- g_free(s);