aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/byte_view_tab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/byte_view_tab.cpp')
-rw-r--r--ui/qt/byte_view_tab.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/qt/byte_view_tab.cpp b/ui/qt/byte_view_tab.cpp
index 36a21c0d1f..2974a215ed 100644
--- a/ui/qt/byte_view_tab.cpp
+++ b/ui/qt/byte_view_tab.cpp
@@ -94,8 +94,10 @@ void ByteViewTab::addTab(const char *name, tvbuff_t *tvb) {
encoding = (packet_char_enc)cap_file_->current_frame->flags.encoding;
QByteArray data;
- if ( tvb )
- data = QByteArray((const char *) tvb_memdup(wmem_file_scope(), tvb, 0, -1), tvb_captured_length(tvb));
+ if ( tvb ) {
+ int data_len = (int) tvb_captured_length(tvb);
+ data = QByteArray::fromRawData((const char *) tvb_get_ptr(tvb, 0, data_len), data_len);
+ }
ByteViewText * byte_view_text = new ByteViewText(data, encoding, this);
byte_view_text->setAccessibleName(name);