mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 04:46:22 +00:00
fix: address config injection and SIGCHLD handling
- Sanitize account names to prevent GKeyFile config injection by blocking special characters like #, \n, and \r. - Ensure GLib's SIGCHLD handler is initialized before forking external editors to prevent zombie processes. - Add missing error check for OMEMO random key generation. - Replace hardcoded console tab ID with a named constant. - Log invalid JIDs safely to prevent potential null pointer issues.
This commit is contained in:
@@ -121,6 +121,12 @@ launch_editor(gchar* initial_content, void (*callback)(gchar* content, void* dat
|
||||
|
||||
ui_suspend();
|
||||
|
||||
// Ensure GLib's SIGCHLD handler is installed before forking to prevent
|
||||
// zombie children if the editor is launched before the main loop starts.
|
||||
GMainContext* main_ctx = g_main_context_default();
|
||||
g_main_context_acquire(main_ctx);
|
||||
g_main_context_release(main_ctx);
|
||||
|
||||
pid_t pid = fork();
|
||||
if (pid == -1) {
|
||||
log_error("[Editor] Failed to fork: %s", strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user