mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
main/stasis_channels.c: Fix crash when setting a global variable with invalid UTF8 characters
Add check for null value of chan before referencing it with ast_channel_name()
Resolves: #999
(cherry picked from commit 3e31489415
)
This commit is contained in:
committed by
Asterisk Development Team
parent
2d2d17811a
commit
891e60e22e
@@ -1185,7 +1185,7 @@ void ast_channel_publish_varset(struct ast_channel *chan, const char *name, cons
|
|||||||
value, strlen(value));
|
value, strlen(value));
|
||||||
|
|
||||||
ast_log(LOG_WARNING, "%s: The contents of variable '%s' had invalid UTF-8 sequences which were replaced",
|
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}",
|
blob = ast_json_pack("{s: s, s: s}",
|
||||||
|
Reference in New Issue
Block a user