diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-09-22 21:18:19 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-09-22 21:18:19 +0000 |
commit | 6906841368a2add42afaf5601f838ffc04375992 (patch) | |
tree | 1c6b02eae9e797eed4134b2dddf4172afa1974d3 /epan/dissectors/packet-xml.c | |
parent | 1f2dbd7bdfd6bba5d5ef7867a0689e349dca3283 (diff) |
bugfix: don't crash, if current_frame->ns == NULL
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15967 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-xml.c')
-rw-r--r-- | epan/dissectors/packet-xml.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c index f5cfa3ca0f..f16ce46997 100644 --- a/epan/dissectors/packet-xml.c +++ b/epan/dissectors/packet-xml.c @@ -198,7 +198,7 @@ static void after_token(void* tvbparse_data, const void* wanted_data _U_, tvbpar proto_item* pi; if (tok->id == XML_CDATA) { - hfid = current_frame->ns->hf_cdata; + hfid = current_frame->ns ? current_frame->ns->hf_cdata : xml_ns.hf_cdata; } else if ( tok->id > 0) { hfid = tok->id; } else { @@ -297,14 +297,18 @@ static void before_tag(void* tvbparse_data, const void* wanted_data _U_, tvbpars } else { name = tvb_get_ephemeral_string(name_tok->tvb,name_tok->offset,name_tok->len); g_strdown(name); + + if(current_frame->ns) { + ns = g_hash_table_lookup(current_frame->ns->elements,name); - ns = g_hash_table_lookup(current_frame->ns->elements,name); - - if (!ns) { - if (! ( ns = g_hash_table_lookup(root_ns->elements,name) ) ) { - ns = &unknown_ns; - } - } + if (!ns) { + if (! ( ns = g_hash_table_lookup(root_ns->elements,name) ) ) { + ns = &unknown_ns; + } + } + } else { + ns = &unknown_ns; + } } pi = proto_tree_add_item(current_frame->tree,ns->hf_tag,tok->tvb,tok->offset,tok->len,FALSE); |