Wireshark-bugs: [Wireshark-bugs] [Bug 9983] Malformed packets not listed in Expert Infos list
Date: Thu, 17 Apr 2014 10:24:17 +0000

Comment # 9 on bug 9983 from
This seems to be the problematic part of proto_tree_add_bytes_format

    if (!(PTREE_DATA(tree)->visible)) {                 \
        if (PTREE_FINFO(tree)) {                \
            if ((hfinfo->ref_type != HF_REF_TYPE_DIRECT)    \
                && (hfinfo->type != FT_PROTOCOL ||      \
                PTREE_DATA(tree)->fake_protocols)) {    \
                /* just return tree back to the caller */\
                return tree;                \
            }                           \
        }                               \
    }

ref_type is HF_REF_TYPE_NONE, type is FT_BYTES (and fake_protocols 1). So
proto_tree_add_bytes_format will return without checking lengths or anything. I
am not familiar in this part, perhaps you have more ideas to fix this?

Should we add a tvb_ensure_bytes_exist(tvb, offset, payload_length) before
calling proto_tree_add_bytes_format? Similar for the padding?

Also, please comment on https://code.wireshark.org/review/#/c/1105/, should the
messages be the same?


You are receiving this mail because:
  • You are watching all bug changes.