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

Sean Bright asteriskteam at digium.com
Wed Jan 12 13:40:13 CST 2022


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17850 )


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



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/50/17850/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/+/17850
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: Ia2e5769868e2792313c2d7c07996efe009c6f8d5
Gerrit-Change-Number: 17850
Gerrit-PatchSet: 1
Gerrit-Owner: 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/20220112/dffcc1bd/attachment-0001.html>


More information about the asterisk-code-review mailing list