]> 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-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Fri, 11 Aug 2023 13:29:06 +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 9aa980da3a85cec06b858c2baa429a15cb816921..57bf82808885b21eece3fd0b0b0fa643edd2d234 100644 (file)
@@ -467,7 +467,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;
        }