https://bugs.kde.org/show_bug.cgi?id=515904

            Bug ID: 515904
           Summary: Kaidan 0.15.0 (Flatpak) crashes when receiving an
                    incoming contact request (<presence
                    type="subscribe"/>) from another XMPP client.
    Classification: Applications
           Product: kaidan
      Version First unspecified
       Reported In:
          Platform: Mint (Ubuntu based)
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Steps to reproduce:

Create account on Kaidan (e.g. [email protected])
>From a different client (e.g. Dinox), add [email protected] as contact
Kaidan crashes immediately
Note: Sending contact requests from Kaidan to Dinox works fine. The crash only
happens on incoming requests.

Probable cause:

In src/OmemoController.cpp, function initializeChat():
if (RosterModel::instance()->item(m_accountSettings->jid(),
jid)->isReceivingPresence()) {
RosterModel::instance()->item(...) returns std::optional<RosterItem>.

When an incoming subscription request is received,
RosterController::handleSubscriptionRequest() calls
processSubscriptionRequestFromStranger() which calls addContact() — but this is
asynchronous (roster IQ set + server response). Before the roster item exists,
Kaidan appears to open the chat view, which triggers initializeChat(). At this
point, item() returns std::nullopt, and dereferencing it with
->isReceivingPresence() causes undefined behavior / segfault.

Side effect: After the crash, Kaidan's OMEMO database appears to be corrupted —
after restart, OMEMO encryption no longer works for any contact (not just the
one that triggered the crash). Only unencrypted messages can be sent.
Otherwise, Omemo 2 works wonderfully between Kaidan and Dinox.

Environment:

Kaidan 0.15.0 (Flatpak, im.kaidan.kaidan)
Linux (Flatpak system install)
ejabberd server 26.1

Ralf Peter

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

Reply via email to