diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-08-17 13:18:30 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-08-18 10:52:08 +0000 |
commit | df17ff3cac653eaf4a499ce5fd4cead59ada81a0 (patch) | |
tree | 2d158d9e15962b9c193b867b5c064d73ddac3551 /ui/qt/service_response_time_dialog.cpp | |
parent | 9e7277963646b0adbf9d929bb140a111ef357493 (diff) | |
download | wireshark-df17ff3cac653eaf4a499ce5fd4cead59ada81a0.tar.gz |
Qt: Fix use-after-free pattern
QString.toUtf8() returns a QByteArray object and .constData() returns
a pointer inside that object. It is not safe to store this pointer as
it will become invalid after the statement.
Change-Id: I8f54ede75577719008835038934e935cd5feba3f
Reviewed-on: https://code.wireshark.org/review/10067
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/service_response_time_dialog.cpp')
-rw-r--r-- | ui/qt/service_response_time_dialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/qt/service_response_time_dialog.cpp b/ui/qt/service_response_time_dialog.cpp index 80381acb57..b976b5f0f2 100644 --- a/ui/qt/service_response_time_dialog.cpp +++ b/ui/qt/service_response_time_dialog.cpp @@ -307,9 +307,10 @@ void ServiceResponseTimeDialog::fillTree() srt_table_dissector_init(srt_, srt_data.srt_array, NULL, NULL); + QString display_filter = displayFilter(); GString *error_string = register_tap_listener(get_srt_tap_listener_name(srt_), &srt_data, - displayFilter(), + display_filter.toUtf8().constData(), 0, tapReset, get_srt_packet_func(srt_), |