]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
say.c: Prevent erroneous failures with 'say' family of functions.
authorSean Bright <sean.bright@gmail.com>
Wed, 12 Jan 2022 19:20:34 +0000 (14:20 -0500)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 17 Jan 2022 13:25:34 +0000 (07:25 -0600)
A regression was introduced in ASTERISK~29531 that caused 'say'
functions to fail with file lists that would previously have
succeeded. This caused affected channels to hang up where previously
they would have continued.

We now explicitly check for the empty string to restore the previous
behavior.

ASTERISK-29859 #close

Change-Id: Ia2e5769868e2792313c2d7c07996efe009c6f8d5

main/say.c

index 54aefe0df10fa4c945c358a3b231b57ca7905abd..56e6b8d4568451e4e3eaaf7d3abe0d55db565fa5 100644 (file)
@@ -180,6 +180,13 @@ static int say_filenames(struct ast_channel *chan, const char *ints, const char
        if (!filenames) {
                return -1;
        }
+
+       /* No filenames to play? Return success so we don't hang up erroneously */
+       if (ast_str_strlen(filenames) == 0) {
+               ast_free(filenames);
+               return 0;
+       }
+
        files = ast_str_buffer(filenames);
 
        while ((fn = strsep(&files, "&"))) {