]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
manager: Tolerate stasis messages with no channel snapshot.
authorJoshua C. Colp <jcolp@sangoma.com>
Wed, 9 Aug 2023 10:57:33 +0000 (07:57 -0300)
committerAsterisk Development Team <asteriskteam@digium.com>
Wed, 6 Sep 2023 16:46:46 +0000 (16:46 +0000)
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)

main/manager_channels.c

index 8af3465a29644d6c0096aa9b9f98acd0fb0f11a4..344a2487a77c75415688cd9718bf55bf9417a51b 100644 (file)
@@ -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;
        }