[Asterisk-code-review] main/app: Only look to end of file if ':end' is specified, a... (asterisk[master])

Matt Jordan asteriskteam at digium.com
Sun Feb 28 19:09:12 CST 2016


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/2317

Change subject: main/app: Only look to end of file if ':end' is specified, and not just ':'
......................................................................

main/app: Only look to end of file if ':end' is specified, and not just ':'

There is a little known feature in app_controlplayback that will cause the
specified offset to be used relative to the end of a file if a ':end' is
detected within the filename.

This feature is pretty bad, but okay.

However, a bug exists in this code where a ':' detected in the filename
will cause the end pointer to be non-NULL, even if the full ':end' isn't
specified. This causes us to treat an unspecified offset (0) as being
"start playing from the end of the file", resulting in no file playback
occurring.

This patch fixes this bug by resetting the end pointer if ':end' is not
found in the filename.

Change-Id: Ib4c7b1b45283e4effd622a970055c51146892f35
---
M main/app.c
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/17/2317/1

diff --git a/main/app.c b/main/app.c
index 826e411..e1d7049 100644
--- a/main/app.c
+++ b/main/app.c
@@ -1112,6 +1112,8 @@
 		if (!strcasecmp(end, ":end")) {
 			*end = '\0';
 			end++;
+		} else {
+			end = NULL;
 		}
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/2317
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4c7b1b45283e4effd622a970055c51146892f35
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list