[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kexi] src: Avoid nullptr dereference
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2016-03-31 21:24:35
Message-ID: E1alk4x-00079r-0K () scm ! kde ! org
[Download RAW message or body]

Git commit a22cec4fc7f853433c2bca3263cd8d77f4a7c677 by Jaroslaw Staniek.
Committed on 31/03/2016 at 21:18.
Pushed by staniek into branch 'master'.

Avoid nullptr dereference

(coverity)

M  +2    -1    src/formeditor/form.cpp
M  +3    -2    src/plugins/forms/widgets/kexidbform.cpp

http://commits.kde.org/kexi/a22cec4fc7f853433c2bca3263cd8d77f4a7c677

diff --git a/src/formeditor/form.cpp b/src/formeditor/form.cpp
index 6d198d3..931302d 100644
--- a/src/formeditor/form.cpp
+++ b/src/formeditor/form.cpp
@@ -1519,7 +1519,8 @@ void Form::createPropertiesForWidget(QWidget *w)
         }
         const char* propertyName = meta.name();
         QWidget *subwidget = subMeta.isValid()//subpropIface
-                             ? subpropIface->subwidget() : w;
+                             ? (subpropIface ? subpropIface->subwidget() : 0)
+                             : w;
         WidgetInfo *subwinfo = subwidget ? library()->widgetInfoForClassName(
                                    subwidget->metaObject()->className()) : 0;
 //  qDebug() << "$$$ " << subwidget->className();
diff --git a/src/plugins/forms/widgets/kexidbform.cpp \
b/src/plugins/forms/widgets/kexidbform.cpp index 4f8196d..565f576 100644
--- a/src/plugins/forms/widgets/kexidbform.cpp
+++ b/src/plugins/forms/widgets/kexidbform.cpp
@@ -354,8 +354,9 @@ bool KexiDBForm::eventFilter(QObject * watched, QEvent * e)
 
             if (tab || backtab) {
                 //the watched widget can be a subwidget of a real widget, e.g. a \
                drop down button of image box: find it
-                while (!KexiFormManager::self()->library()->widgetInfoForClassName(
-                            realWidget->metaObject()->className())) {
+                while (realWidget && \
!KexiFormManager::self()->library()->widgetInfoForClassName( +                        \
realWidget->metaObject()->className())) +                {
                     realWidget = realWidget->parentWidget();
                 }
                 if (!realWidget)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic