diff options
author | Michael Mann <mmann78@netscape.net> | 2014-11-22 20:47:59 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-11-25 15:18:05 +0000 |
commit | e3a04bb392824781b8a3ef6ec98a37ef96c6c827 (patch) | |
tree | c51c48f12e302c76bc2c1619d24b9787384db261 /epan/dissectors/packet-spdy.c | |
parent | 7f22ce7f6610333f4b40dfad6cde22e352abae6f (diff) |
Ensure dissector data parameter is used instead of pinfo->private_data when passing data between dissectors using the "media_type" subdissector.
Change-Id: I82cbfed770b41404bc42cb6a4413db07d04dffdc
Reviewed-on: https://code.wireshark.org/review/5462
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-spdy.c')
-rw-r--r-- | epan/dissectors/packet-spdy.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/epan/dissectors/packet-spdy.c b/epan/dissectors/packet-spdy.c index b6987f0f58..d2aee32869 100644 --- a/epan/dissectors/packet-spdy.c +++ b/epan/dissectors/packet-spdy.c @@ -746,9 +746,7 @@ static int dissect_spdy_data_payload(tvbuff_t *tvb, tvbuff_t *next_tvb = NULL; tvbuff_t *data_tvb = NULL; spdy_stream_info_t *si = NULL; - void *save_private_data = NULL; guint8 *copied_data; - gboolean private_data_changed = FALSE; gboolean is_single_chunk = FALSE; gboolean have_entire_body; char *media_str = NULL; @@ -904,14 +902,8 @@ static int dissect_spdy_data_payload(tvbuff_t *tvb, * Content-Type value. Is there any subdissector * for that content type? */ - save_private_data = pinfo->private_data; - private_data_changed = TRUE; - if (si->content_type_parameters) { - pinfo->private_data = wmem_strdup(wmem_packet_scope(), si->content_type_parameters); - media_str = (char*)pinfo->private_data; - } else { - pinfo->private_data = NULL; + media_str = wmem_strdup(wmem_packet_scope(), si->content_type_parameters); } /* * Calling the string handle for the media type @@ -926,7 +918,7 @@ static int dissect_spdy_data_payload(tvbuff_t *tvb, /* * We have a subdissector - call it. */ - dissected = call_dissector(handle, data_tvb, pinfo, spdy_tree); + dissected = call_dissector_with_data(handle, data_tvb, pinfo, spdy_tree, media_str); } else { dissected = FALSE; } @@ -944,17 +936,11 @@ static int dissect_spdy_data_payload(tvbuff_t *tvb, body_dissected: /* - * Do *not* attempt at freeing the private data; - * it may be in use by subdissectors. - */ - if (private_data_changed) { /*restore even NULL value*/ - pinfo->private_data = save_private_data; - } - /* * We've processed frame->length bytes worth of data * (which may be no data at all); advance the * offset past whatever data we've processed. */ + ; } return frame->length; } |