{
/* Set up structures we will need to add the protocol subtree and manage it */
proto_item *ti;
- proto_tree *a11_tree;
+ proto_tree *a11_tree = NULL;
proto_item *tf;
proto_tree *flags_tree;
guint8 type;
break;
} /* End switch */
- if (tree) {
+ if (tree && a11_tree) {
if (tvb_reported_length_remaining(tvb, offset) > 0)
dissect_a11_extensions(tvb, offset, a11_tree);
}
int old_offset;
gint32 bytes;
int i, n, pos, neg, acl;
- char user[128]; /* Be sure to adjust sscanf()s below if length is changed... */
+ char user[128] = "[Unknown]"; /* Be sure to adjust sscanf()s below if length is changed... */
old_offset = offset;
bytes = tvb_get_ntohl(tvb, offset);
offset += 4;
- if( aim_tree )
+ if( aim_tree && subtype != NULL )
{
offset = orig_offset;
ti1 = proto_tree_add_text(aim_tree, tvb, 6, 10,
if (family)
col_set_str(pinfo->cinfo, COL_PROTOCOL, family->name);
- if(subtype && family)
+ if(subtype != NULL && family != NULL)
{
col_set_str(pinfo->cinfo, COL_INFO, family->name);
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", subtype->name);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Subtype: 0x%04x", subtype_id);
}
- if(aim_tree && family)
+ if(aim_tree && family != NULL)
{
proto_item *ti = proto_tree_add_item(root_tree, family->proto_id, subtvb, 0, -1, FALSE);
family_tree = proto_item_add_subtree(ti, family->ett);
proto_item_append_text(ti, ", %s", subtype->name);
}
- if(tvb_length_remaining(tvb, offset) > 0 && subtype && subtype->dissector)
+ if(tvb_length_remaining(tvb, offset) > 0 && subtype != NULL && subtype->dissector)
{
subtype->dissector(subtvb, pinfo, family_tree);
}
break;
}
- if (leg && ( (! leg->msgs) || leg->msgs->last->framenum < pinfo->fd->num ) ) {
+ if (leg != NULL && ( (! leg->msgs) || leg->msgs->last->framenum < pinfo->fd->num ) ) {
alcap_msg_data_t* msg = se_alloc(sizeof(alcap_msg_data_t));
msg->msg_type = msg_info->msg_type;
msg->framenum = pinfo->fd->num;
amr_capability_t *ftr = NULL;
actx = get_asn1_ctx(pinfo->private_data);
- DISSECTOR_ASSERT(actx);
- if (tree) {
+ DISSECTOR_ASSERT(actx != NULL);
+ if (tree && actx != NULL) {
ftr = find_cap(pinfo->match_string);
if (ftr) {
proto_item_append_text(actx->created_item, " - %s", ftr->name);
const ext_value_string_t *ansi_a_bsmap_strings = NULL;
const ext_value_string_t *ansi_a_dtap_strings = NULL;
const ext_value_string_t *ansi_a_elem_1_strings = NULL;
-static guint ansi_a_elem_1_max = 0;
+static gint ansi_a_elem_1_max = 0;
static int ansi_a_tap = -1;
curr_offset = offset;
consumed = 0;
- if ((unsigned) idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
curr_offset = offset;
consumed = 0;
- if ((unsigned) idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
curr_offset = offset;
consumed = 0;
- if ((unsigned)idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
curr_offset = offset;
consumed = 0;
- if ((unsigned) idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
curr_offset = offset;
consumed = 0;
- if ((unsigned) idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
guint32 curr_offset;
guint32 consumed;
guint curr_len;
- guint idx;
+ gint idx;
guint8 oct;
curr_offset = offset;
}
} else {
proto_tree_add_item(tree, hf_aoe_astatus, tvb, offset, 1, FALSE);
- if(ata_info && ata_info->request_frame){
+ if(ata_info != NULL && ata_info->request_frame){
/* we dont know what command it was unless we saw the request_frame */
tmp_item=proto_tree_add_uint(tree, hf_aoe_acmd, tvb, 0, 0, ata_info->cmd);
PROTO_ITEM_SET_GENERATED(tmp_item);