diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-06-24 08:57:41 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-06-24 08:57:41 +0000 |
commit | 7f08072192eb76b6c2e842dc97733cb6a361b673 (patch) | |
tree | 169100abcfc7289241ced282a90a706a560c1e2a /epan | |
parent | b67f63560e006ca6fb6e445bac0ca61abcadf281 (diff) |
fix to ber NULL handling
1, make it actually show the hf field when present
2, make it handle imlicit_tag properly
svn path=/trunk/; revision=14741
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ber.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index f5b4593c84..466b5fabef 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -634,21 +634,25 @@ dissect_ber_null(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tv guint32 tag, len; int offset_old; - offset_old = offset; - offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - if ((pc) || - (!implicit_tag && ((class != BER_CLASS_UNI) || (tag != BER_UNI_TAG_NULL)))) { - proto_tree_add_text(tree, tvb, offset_old, offset - offset_old, "BER Error: NULL expected but Class:%d(%s) PC:%d Tag:%d was unexpected", class,val_to_str(class,ber_class_codes,"Unknown"), pc, tag); - } + if(!implicit_tag){ + offset_old = offset; + offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); + if ((pc) || + (!implicit_tag && ((class != BER_CLASS_UNI) || (tag != BER_UNI_TAG_NULL)))) { + proto_tree_add_text(tree, tvb, offset_old, offset - offset_old, "BER Error: NULL expected but Class:%d(%s) PC:%d Tag:%d was unexpected", class,val_to_str(class,ber_class_codes,"Unknown"), pc, tag); + } - offset_old = offset; - offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL); - if (len) { - proto_tree_add_text(tree, tvb, offset_old, offset - offset_old, "BER Error: NULL expect zero length but Length=%d", len); - proto_tree_add_text(tree, tvb, offset, len, "BER Error: unexpected data in NULL type"); - offset += len; + offset_old = offset; + offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL); + if (len) { + proto_tree_add_text(tree, tvb, offset_old, offset - offset_old, "BER Error: NULL expect zero length but Length=%d", len); + proto_tree_add_text(tree, tvb, offset, len, "BER Error: unexpected data in NULL type"); + offset += len; + } } + proto_tree_add_item(tree, hf_id, tvb, offset, 0, FALSE); + return offset; } |