Commit graph

2 commits

Author SHA1 Message Date
0d230c5397 Fix dangling pointers and missing null check in flashlight helper
The two const char* variables were pointing into QByteArray
temporaries that were destroyed at the end of each declaration
statement. By the time they were passed to udev, the memory was
freed. Hold the QByteArrays in named locals so the data stays
alive for the duration of the function.

udev_device_new_from_syspath returns NULL if the syspath is
invalid or the device disappears between enumeration and the
privileged call. Add an early-return guard so the subsequent
udev_device_set_sysattr_value call is never reached with a null
device pointer.

Also drop the unnecessary const_cast: udev_device_set_sysattr_value
takes const char*, not char*.
2026-04-18 19:41:04 +02:00
Florian RICHER
c42758b335 quicksettings: Move Flashlight write to KAuth 2025-07-23 11:34:33 +02:00