From: Joshua C. Colp Date: Wed, 9 Aug 2023 10:57:33 +0000 (-0300) Subject: manager: Tolerate stasis messages with no channel snapshot. X-Git-Tag: 18.20.0-rc1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ef84b80768c41252836a643e0d285f786a837d6;p=thirdparty%2Fasterisk.git manager: Tolerate stasis messages with no channel snapshot. In some cases I have yet to determine some stasis messages may be created without a channel snapshot. This change adds some tolerance to this scenario, preventing a crash from occurring. (cherry picked from commit 9b607747ce3064a0229bcfcd45721c5e95784f95) --- diff --git a/main/manager_channels.c b/main/manager_channels.c index 8af3465a29..344a2487a7 100644 --- a/main/manager_channels.c +++ b/main/manager_channels.c @@ -493,7 +493,7 @@ struct ast_str *ast_manager_build_channel_state_string_prefix( char *connected_name; int res; - if (snapshot->base->tech_properties & AST_CHAN_TP_INTERNAL) { + if (!snapshot || (snapshot->base->tech_properties & AST_CHAN_TP_INTERNAL)) { return NULL; }