Don't crash if a null OID pointer is passed to

"call_ber_oid_callback()".  (Arguably, the caller of
"call_ber_oid_callback()" should check for that, and report that a
presumably-required field is missing.)

svn path=/trunk/; revision=16544
This commit is contained in:
Guy Harris 2005-11-18 10:06:47 +00:00
parent 3f047721a3
commit 12ae3bba4d
1 changed files with 6 additions and 2 deletions

View File

@ -317,11 +317,15 @@ call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
tvbuff_t *next_tvb;
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
if(!dissector_try_string(ber_oid_dissector_table, oid, next_tvb, pinfo, tree)){
if(oid == NULL ||
!dissector_try_string(ber_oid_dissector_table, oid, next_tvb, pinfo, tree)){
proto_item *item=NULL;
proto_tree *next_tree=NULL;
item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "BER: Dissector for OID:%s not implemented. Contact Ethereal developers if you want this supported", oid);
if (oid == NULL)
item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "BER: No OID supplied to call_ber_oid_callback");
else
item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "BER: Dissector for OID:%s not implemented. Contact Ethereal developers if you want this supported", oid);
if(item){
next_tree=proto_item_add_subtree(item, ett_ber_unknown);
}