Wireshark-commits: [Wireshark-commits] master 7957621: kafka: lz4: free the composite tvb only once
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=79576219c92e252c0700cdbe729bfb0fe6c72bd9
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark
Commits:
7957621 by Martin Kaiser (wireshark@xxxxxxxxx):
kafka: lz4: free the composite tvb only once
Try to clean up the composite tvb handling during lz4 decompression.
If we detect an error straight away before doing any lz4 decompression, we
don't allocate a composite tvb at all. The comments in the tvb code say
explicitly that we must not call tvb_new_composite() without adding at
least one piece of data.
If we start decompressing and run into problems after creating the
composite tvb and linking it to the packet's main tvb, we must not free
the composite tvb manually. The epan library will do this for us when
dissection of the packet is finished.
While at it, make sure that we always finalize the composite tvb if we
allocated it and added data to it.
Bug: 16672
Change-Id: I3e3fb303a823640d7707277a109019fc3aad22f2
Reviewed-on: https://code.wireshark.org/review/37696
Petri-Dish: Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>
Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
Actions performed:
from 23aa1ed mplog: increase the max packet length to 4096
add 7957621 kafka: lz4: free the composite tvb only once
Summary of changes:
epan/dissectors/packet-kafka.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)