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

Friendly Automation asteriskteam at digium.com
Mon Jan 17 07:30:02 CST 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17849 )

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(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Friendly Automation: Approved for Submit



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/+/17849
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ia2e5769868e2792313c2d7c07996efe009c6f8d5
Gerrit-Change-Number: 17849
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220117/a6dbc816/attachment-0001.html>


More information about the asterisk-code-review mailing list