Skip to content

Fix reliability, security, and correctness issues across codebase#17

Merged
jwinarske merged 1 commit into
mainfrom
jw/flatpak
Mar 26, 2026
Merged

Fix reliability, security, and correctness issues across codebase#17
jwinarske merged 1 commit into
mainfrom
jw/flatpak

Conversation

@jwinarske
Copy link
Copy Markdown
Owner

Reliability fixes:

  • signal_handler.h: Replace non-async-signal-safe spdlog call in signal handler with ::write() to prevent deadlocks/crashes
  • login1_manager_client.cc: Fix iterator invalidation UB in destructor (erase-while-iterating via views::keys); replace with .clear()
  • hostname1_client.cc: Fix inverted condition in printHostname1() that printed StaticHostname only when empty (2 locations)
  • udisks2_partition_table.h: Fix wrong proxy base class (Partition_proxy instead of PartitionTable_proxy)
  • udisks2_manager.cc: Add missing cleanup in onInterfacesRemoved() for all 9 interface types (was log-only, leaked objects)
  • timedate1_client.cc: Replace thread-unsafe std::localtime() with localtime_r()
  • upower_client.h: Simplify redundant operator-precedence expression
  • udisks2_monitor_daemon.cc: Replace infinite while(true)/sleep loop with monitorLoop() and signal handling for graceful shutdown
  • connman/main.cc: Fix exit code from 1 to 0 on normal termination
  • avahi/main.cc: Fix typo "NSSS upport" -> "NSS Support"
  • horipad input_reader.h: Remove duplicate #include

Security fixes:

  • xbox_controller.cc, dual_sense.cc, horipad_steam.cc: Add null guard before input_reader_->stop() in udev remove callback
  • hidraw.hpp: Fix ::toupper UB with signed char by using unsigned char lambda; add .contains("UNIQ") guard before .at() access
  • xbox_controller.cc, dual_sense.cc: Fix ::tolower UB same way
  • All 3 input_reader.cc: Add HID_MAX_DESCRIPTOR_SIZE bounds check on desc_size from ioctl before using it
  • hidraw.hpp, udev_monitor.hpp: Replace direct spdlog includes with centralized logging.h; convert spdlog:: calls to LOG_* macros

Other:

  • logging.h: British "recognised" -> US English "recognized"
  • CMakeLists.txt: Add flatpak subdirectory
  • All modified files formatted with clang-format-19

Reliability fixes:
- signal_handler.h: Replace non-async-signal-safe spdlog call in signal
  handler with ::write() to prevent deadlocks/crashes
- login1_manager_client.cc: Fix iterator invalidation UB in destructor
  (erase-while-iterating via views::keys); replace with .clear()
- hostname1_client.cc: Fix inverted condition in printHostname1() that
  printed StaticHostname only when empty (2 locations)
- udisks2_partition_table.h: Fix wrong proxy base class (Partition_proxy
  instead of PartitionTable_proxy)
- udisks2_manager.cc: Add missing cleanup in onInterfacesRemoved() for
  all 9 interface types (was log-only, leaked objects)
- timedate1_client.cc: Replace thread-unsafe std::localtime() with
  localtime_r()
- upower_client.h: Simplify redundant operator-precedence expression
- udisks2_monitor_daemon.cc: Replace infinite while(true)/sleep loop
  with monitorLoop() and signal handling for graceful shutdown
- connman/main.cc: Fix exit code from 1 to 0 on normal termination
- avahi/main.cc: Fix typo "NSSS upport" -> "NSS Support"
- horipad input_reader.h: Remove duplicate #include

Security fixes:
- xbox_controller.cc, dual_sense.cc, horipad_steam.cc: Add null guard
  before input_reader_->stop() in udev remove callback
- hidraw.hpp: Fix ::toupper UB with signed char by using unsigned char
  lambda; add .contains("UNIQ") guard before .at() access
- xbox_controller.cc, dual_sense.cc: Fix ::tolower UB same way
- All 3 input_reader.cc: Add HID_MAX_DESCRIPTOR_SIZE bounds check on
  desc_size from ioctl before using it
- hidraw.hpp, udev_monitor.hpp: Replace direct spdlog includes with
  centralized logging.h; convert spdlog:: calls to LOG_* macros

Other:
- logging.h: British "recognised" -> US English "recognized"
- CMakeLists.txt: Add flatpak subdirectory
- All modified files formatted with clang-format-19

Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
@jwinarske jwinarske merged commit bb4d4be into main Mar 26, 2026
6 checks passed
@jwinarske jwinarske deleted the jw/flatpak branch March 26, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant