Bugfix for proto_item_get_subtree()

Not all proto_item* fields have a subtree associated to it.
If it doesnt have a subtree  fi  will be NULL,
test fi for NULL before trying to dereference it to avoid a coredump.



svn path=/trunk/; revision=14134
This commit is contained in:
Ronnie Sahlberg 2005-04-19 11:59:40 +00:00
parent 68928a2e81
commit c27c30ba02
1 changed files with 1 additions and 1 deletions

View File

@ -2448,7 +2448,7 @@ proto_item_get_subtree(proto_item *pi) {
if (!pi)
return(NULL);
fi = PITEM_FINFO(pi);
if (fi->tree_type == -1)
if ( (!fi) || (fi->tree_type == -1) )
return(NULL);
return (proto_tree*) pi;
}