]> 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)
committerJoshua C. Colp <jcolp@sangoma.com>
Fri, 11 Aug 2023 13:29:03 +0000 (13:29 +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.

main/manager_channels.c

index dae737c3a62a7362fc2d81f2b122205ec31ccb82..cf8b335e5142be4c452abf8971f8060d9e6a1cab 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;
        }