diff options
author | Gerald Combs <gerald@wireshark.org> | 2011-02-18 19:57:18 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2011-02-18 19:57:18 +0000 |
commit | c514eaabf99a8d4e89a05a8a4f44ee6ebc0ec9f4 (patch) | |
tree | a920542570ccde884715061b38d710becbef8e34 /plugins/asn1 | |
parent | 3e13ddbadc947658f4f3bf67f8a06746f62519a5 (diff) |
Try to fix some Clan scan-build warnings.
svn path=/trunk/; revision=36003
Diffstat (limited to 'plugins/asn1')
-rw-r--r-- | plugins/asn1/packet-asn1.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/asn1/packet-asn1.c b/plugins/asn1/packet-asn1.c index 4719c16778..af578fca4e 100644 --- a/plugins/asn1/packet-asn1.c +++ b/plugins/asn1/packet-asn1.c @@ -2465,6 +2465,10 @@ define_module(GNode *p, GNode *q) module->type = TBLTYPE_Module; p = g_node_first_child(p); + + if (!p) { + return; + } module->name = get_asn1_string(0, GPOINTER_TO_UINT(p->data)); p = g_node_next_sibling(p); @@ -2643,16 +2647,22 @@ get_values(void) /* collect values from ASN.1 tree */ p = g_node_first_child(asn1_nodes); /* top of the data tree */ p = g_node_first_child(p); + if (!p) return; TT.totalNumModules = get_asn1_uint(GPOINTER_TO_UINT(p->data)); p = g_node_next_sibling(p); + if (!p) return; TT.totalNumTypeDefs = get_asn1_uint(GPOINTER_TO_UINT(p->data)); p = g_node_next_sibling(p); + if (!p) return; TT.totalNumTypes = get_asn1_uint(GPOINTER_TO_UINT(p->data)); p = g_node_next_sibling(p); + if (!p) return; TT.totalNumTags = get_asn1_uint(GPOINTER_TO_UINT(p->data)); p = g_node_next_sibling(p); + if (!p) return; TT.totalNumStrings = get_asn1_uint(GPOINTER_TO_UINT(p->data)); p = g_node_next_sibling(p); + if (!p) return; TT.totalLenStrings = get_asn1_uint(GPOINTER_TO_UINT(p->data)); p = g_node_next_sibling(p); @@ -4661,7 +4671,7 @@ getPDUprops(PDUprops *out, guint offset, guint class, guint tag, guint cons) info = getinfo(pos.node); /* pos now points to the prospective current node, go check it ********************/ - if (asn1_verbose) g_message(" candidate %s '%s'%s%s, %c%d", TBLTYPE(pos.type), ret, + if (asn1_verbose && info) g_message(" candidate %s '%s'%s%s, %c%d", TBLTYPE(pos.type), ret, (ISOPTIONAL)?", optional":empty, (ISIMPLICIT)?", implicit":empty, tag_class[info->tclass], info->tag ); |