https://bugs.kde.org/show_bug.cgi?id=457285
            Bug ID: 457285
           Summary: KConfigWatcher::config() returns nullptr when built
                    without DBUS support
           Product: frameworks-kconfig
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: matt...@mjdsystems.ca
          Reporter: kdu...@redhat.com
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

As additional KDE applications started to use KConfigWatcher, they started to
crash on my laptop running Gentoo Linux.  I was trying to patch them one by one
to prevent the crashes.  Then I realized that kconfig was built without dbus
support on my system.  After rebuilding kconfig with -DKCONFIG_USE_DBUS, the
crashes went away.

I looked into the source code of KConfigWatcher and discovered that its
constructor initializes d->m_config only if KCONFIG_USE_DBUS is defined:
https://github.com/KDE/kconfig/blob/491f5464/src/core/kconfigwatcher.cpp#L47

Consequently KConfigWatcher::config() may return nullptr, which triggers null
dereference at caller's side, where a non-null value is expected.

STEPS TO REPRODUCE
1. build kconfig without dbus support

OBSERVED RESULT
Applications like plasma or kwin start to crash.

EXPECTED RESULT
No crashes.

SOFTWARE/OS VERSIONS
Linux: 5.15.52-gentoo-x86_64
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
Previously reported with backtraces at:
bug #423864 comment #4
bug #453242

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to