diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-04-26 13:13:54 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-04-26 16:41:34 +0000 |
commit | f9522d8a23a375ddc8bd39cf556002cdec346ab1 (patch) | |
tree | d8f7d6d6e0b0458555555d886e10f048b21480b3 /epan/proto.c | |
parent | cfc15838bdecb44ce1a17d47ad015cb9a1e8962c (diff) |
Qt: fix crash on dragging in packet dialog
"packet_dialog.cpp" does not use setCaptureFile, resulting in a NULL
dereference while trying to obtain the dissection context. Apply a fix
similar to v2.5.1rc0-121-g9198448f9d (pass a fixed dissection context to
ProtoTree). Additionally, fix a memleak and correct documentation.
Why not add "proto_tree_->setCaptureFile(cap_file_.capFile())" in
PacketDialog? Well, it also uses "proto_tree_->setRootNode(edt_.tree)"
which means that "cf_->edt" would be different from "edt_". If that is
the case, then "proto_construct_match_selected_string" will not return a
filter for FT_NONE fields (see the call chain in proto.c).
Bug: 14620
Change-Id: I6eeaf32b650a2095e15f64bbe64b54cdd545c7a9
Fixes: v2.5.0rc0-1608-g4d6454e180 ("Qt: Drag n Drop Filter expression from Packet Tree")
Reviewed-on: https://code.wireshark.org/review/27160
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/epan/proto.c b/epan/proto.c index d41a8294ef..fa83e710fd 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -10613,9 +10613,7 @@ proto_can_match_selected(field_info *finfo, epan_dissect_t *edt) * string for the specified field; if it can do so, it returns a pointer * to the string, otherwise it returns NULL. * - * The string is allocated with packet lifetime scope. - * You do not need to [g_]free() this string since it will be automatically - * freed once the next packet is dissected. + * The string is wmem allocated and must be freed with "wmem_free(NULL, ...)". */ char * proto_construct_match_selected_string(field_info *finfo, epan_dissect_t *edt) |