Fix reliability, security, and correctness issues across codebase#17
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reliability fixes:
Security fixes:
Other: