summaryrefslogtreecommitdiff
path: root/ui/qt/extcap_argument_multiselect.cpp
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2016-08-04 17:01:45 +0200
committerRoland Knall <rknall@gmail.com>2016-08-04 16:47:04 +0000
commit6168d8bf809edf514f6356c2c35afb41e6eedf36 (patch)
treeb12aab6e36a7cd0f921811e49d02e04e71f009e6 /ui/qt/extcap_argument_multiselect.cpp
parentd21295f9a6da65420254afba0bb8a64cb4155947 (diff)
downloadwireshark-6168d8bf809edf514f6356c2c35afb41e6eedf36.tar.gz
Qt: fix a NULL pointer dereference in extcap_argument_multiselect.cpp
Guard treeView dereference by a cehck on viewModel (as it is done elsewhere in the file, both are allocated at the same time). This can happen for example when USBPcap lists a USB Hub with no devices connected. Change-Id: Iee412b8c95539e9e3d65706c14f62194cafcaffc Reviewed-on: https://code.wireshark.org/review/16885 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/extcap_argument_multiselect.cpp')
-rw-r--r--ui/qt/extcap_argument_multiselect.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/qt/extcap_argument_multiselect.cpp b/ui/qt/extcap_argument_multiselect.cpp
index 221f0f240b..6a9ab03298 100644
--- a/ui/qt/extcap_argument_multiselect.cpp
+++ b/ui/qt/extcap_argument_multiselect.cpp
@@ -198,7 +198,8 @@ bool ExtArgMultiSelect::isValid()
QString lblInvalidColor = ColorUtils::fromColorT(prefs.gui_text_invalid).name();
QString txtStyle("QTreeView { background-color: %1; } ");
- treeView->setStyleSheet( txtStyle.arg(valid ? QString("") : lblInvalidColor) );
+ if ( viewModel != 0 )
+ treeView->setStyleSheet( txtStyle.arg(valid ? QString("") : lblInvalidColor) );
return valid;
}