Fix multiple bugs in C code: memory leaks, NULL derefs, buffer overflow, OOB reads#10
Merged
micheloosterhof merged 1 commit intomainfrom Feb 10, 2026
Merged
Conversation
…ow, OOB reads
- connection.c: Fix SSL_CTX memory leak for connect-type TLS/DTLS connections
(only listen-type was freed, leaking ctx for outbound connections)
- connection.c: Add NULL check for SSL_CTX_new return value to prevent crash
- connection.c: Add bounds checks to connection_{transport,type,state}_to_string
to prevent out-of-bounds array access on invalid enum values
- incident.c: Fix buffer overflow in opaque_data_dump - indent was unclamped and
g_snprintf size parameter didn't account for indent offset
- log.c: Initialize level to "unknown" in logger_stdout_log and logger_file_log
to prevent NULL pointer dereference in fprintf when no log level matches
- curl/module.c: Add NULL check after tempfile_new() to prevent NULL dereference
and fix write() return type comparison (ssize_t vs size_t)
- python/module.c: Add NULL check after PyImport_Import for traceback module
- python/module.c: Fix memory leaks - add g_strfreev() for sys_paths,
module_names in new() and module_names in hupy()
- python/module.c: Replace VLA with heap allocation in pygetifaddrs to prevent
stack overflow with many network interfaces
https://claude.ai/code/session_014EiJbNgZBQnu8uSe7sWmYN
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.
(only listen-type was freed, leaking ctx for outbound connections)
to prevent out-of-bounds array access on invalid enum values
g_snprintf size parameter didn't account for indent offset
to prevent NULL pointer dereference in fprintf when no log level matches
and fix write() return type comparison (ssize_t vs size_t)
module_names in new() and module_names in hupy()
stack overflow with many network interfaces
https://claude.ai/code/session_014EiJbNgZBQnu8uSe7sWmYN