argument, have it just return; this allows dissectors that don't
explicitly check for a null protocol-tree argument to pass the
protocol-tree argument to "proto_tree_add_XXX()" routines - which means
they'll get a null pointer back if the protocol-tree argument is null
because we're not constructing a protocol tree - and then later use
"proto_item_set_len()" without having to check for a null
protocol-tree-item pointer.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3402
f5534014-38df-0310-8fa8-
9805f1628bb7
/* proto.c
* Routines for protocol tree
*
- * $Id: proto.c,v 1.25 2001/04/23 01:19:39 guy Exp $
+ * $Id: proto.c,v 1.26 2001/05/07 21:06:59 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
void
proto_item_set_len(proto_item *pi, gint length)
{
- field_info *fi = (field_info*) (((GNode*)pi)->data);
+ field_info *fi;
+
+ if (pi == NULL)
+ return;
+ fi = (field_info*) (((GNode*)pi)->data);
fi->length = length;
}