From e0c43fb046795ca6d64d621b1467905abc41186d Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 15 Feb 2017 13:10:04 +0100 Subject: [PATCH] QFileDialog: Protect against nullptr dereference When the QFileDialog receives a language change event, and native dialogs are used, this code path dereference a nullptr in the qFileDialogUi member. Protect by checking the return value of QFileDialogPrivate::usingWidgets() as done in other places deferencing qFileDialogUi. Fixes a crash in GammaRay Change-Id: I3e9eb81c75d9fc983519a58c5ec06e316ac80263 Reviewed-by: Friedemann Kleint Reviewed-by: Marc Mutz --- src/widgets/dialogs/qfiledialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 74875faf21..5892ec6a75 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -656,7 +656,7 @@ void QFileDialogPrivate::retranslateStrings() /* WIDGETS */ if (options->useDefaultNameFilters()) q->setNameFilter(QFileDialogOptions::defaultNameFilterString()); - if (nativeDialogInUse) + if (!usingWidgets()) return; QList actions = qFileDialogUi->treeView->header()->actions();