[Asterisk-code-review] say.c: Prevent erroneous failures with 'say' family of functions. (asterisk[certified/18.9])

Joshua Colp asteriskteam at digium.com
Mon Jan 17 12:46:30 CST 2022


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17887 )


Change subject: say.c: Prevent erroneous failures with 'say' family of functions.
......................................................................

say.c: Prevent erroneous failures with 'say' family of functions.

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
(cherry picked from commit 3fd47840c93bd834cda82562f121eec5883b5a23)
---
M main/say.c
1 file changed, 7 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/87/17887/1

diff --git a/main/say.c b/main/say.c
index ebbb9f0..df9462a 100644
--- a/main/say.c
+++ b/main/say.c
@@ -180,6 +180,13 @@
 	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, "&"))) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17887
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: certified/18.9
Gerrit-Change-Id: Ia2e5769868e2792313c2d7c07996efe009c6f8d5
Gerrit-Change-Number: 17887
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-CC: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220117/0a290a82/attachment.html>


More information about the asterisk-code-review mailing list