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:
@@ -43,7 +43,8 @@ _sanitize_account_name(const char* const name)
|
||||
gchar* sanitized = g_strdup(name);
|
||||
gchar* p = sanitized;
|
||||
while (*p) {
|
||||
if (*p == '[' || *p == ']' || *p == '=') {
|
||||
// GKeyFile special characters: [ ] = # \n \r
|
||||
if (*p == '[' || *p == ']' || *p == '=' || *p == '#' || *p == '\n' || *p == '\r') {
|
||||
*p = '_';
|
||||
}
|
||||
p++;
|
||||
|
||||
Reference in New Issue
Block a user