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:
2026-05-22 18:27:54 +00:00
committed by jabber.developer2
parent adab585c09
commit d3d7c328b4
5 changed files with 16 additions and 2 deletions

View File

@@ -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));