]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
main/stasis_channels.c: Fix crash when setting a global variable with invalid UTF8...
authorJames Terhune <jterhune@fortinet.com>
Mon, 18 Nov 2024 21:54:30 +0000 (16:54 -0500)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 23 Jan 2025 18:39:41 +0000 (18:39 +0000)
Add check for null value of chan before referencing it with ast_channel_name()

Resolves: #999
(cherry picked from commit bece08dcf88be0dba56b96b1c6632cdae8f2a84a)

main/stasis_channels.c

index af2bb1f81032050d057b8ab086ab26577b7b4937..b311df0ff7bbe3da8e914eb75dd07e057b795319 100644 (file)
@@ -1185,7 +1185,7 @@ void ast_channel_publish_varset(struct ast_channel *chan, const char *name, cons
                        value, strlen(value));
 
                ast_log(LOG_WARNING, "%s: The contents of variable '%s' had invalid UTF-8 sequences which were replaced",
-                       ast_channel_name(chan), name);
+                       chan ? ast_channel_name(chan) : "GLOBAL", name);
        }
 
        blob = ast_json_pack("{s: s, s: s}",