diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-09-29 19:05:45 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-10-03 03:52:43 +0000 |
commit | 29fbbfb3d39e801280d21e608bc269af4c1cd0cd (patch) | |
tree | 4a3aaa77aafa033afb765148a71d666821515b09 /ui | |
parent | e885798f22a911c2b23e6e66f9dc98b3b2cc167c (diff) |
Qt/ByteViewTab: document potential pitfall
If ByteViewTab is related to a use-after-free crash, then the issue is
probably related to the backing buffer becoming invalid. Document this.
Change-Id: I7f7c8daaf86b42f00b7886de54507d425e5312f6
Reviewed-on: https://code.wireshark.org/review/29924
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/byte_view_tab.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/qt/byte_view_tab.cpp b/ui/qt/byte_view_tab.cpp index eff04661fa..533e128118 100644 --- a/ui/qt/byte_view_tab.cpp +++ b/ui/qt/byte_view_tab.cpp @@ -96,6 +96,8 @@ void ByteViewTab::addTab(const char *name, tvbuff_t *tvb) { if ( tvb ) { int data_len = (int) tvb_captured_length(tvb); if (data_len > 0) { + // Note: this does not copy the data and will be invalidated when + // the tvb becomes invalid (e.g. when the current packet changes). data = QByteArray::fromRawData((const char *) tvb_get_ptr(tvb, 0, data_len), data_len); } } |