Skip to content

applets/devicenotifier: ensure udi is not dangling to fix crash

Fushan Wen requested to merge work/fuf/evilcopy into master

Reason for the change

udi in DeviceControl::deviceDelayRemove is passed as const reference, so the inner refcount will not be increased, which causes a problem that if udi is from m_removeTimers, it will become dangling after the timer data is removed. This ensures the timer data is removed at the end of DeviceControl::deviceDelayRemove to fix the crash.

As a drive-by, in the timer, checking if udi exists in m_devices is unnecessary because DeviceControl::deviceDelayRemove also checks that.

Test plan

Screenshots or screen recordings

Bugs fixed

SENTRY: PLASMA-WORKSPACE-15SV FIXED-IN: 6.2.2

@nicolasfella @littlesweet

Edited by Fushan Wen

Merge request reports

Loading