summaryrefslogtreecommitdiff
path: root/main/app.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2016-02-28 19:05:16 -0600
committerSean Bright <sean.bright@gmail.com>2017-08-24 13:37:52 -0500
commitfff2f686164ecd3992f8bc294e04b18ebadc0135 (patch)
tree2a3299aacb393c560137c8b1f4397cb9fe694c6f /main/app.c
parentd251a961ace674218488e6a906a874d2ef2212c1 (diff)
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. ASTERISK-23608 #close Reported by: Jonathan White Change-Id: Ib4c7b1b45283e4effd622a970055c51146892f35 (cherry picked from commit 13efea24f7ce6ccc01d1a5a0603be2636d83a408)
Diffstat (limited to 'main/app.c')
-rw-r--r--main/app.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/app.c b/main/app.c
index 85dc87d3e..8ea6f82d9 100644
--- a/main/app.c
+++ b/main/app.c
@@ -1113,6 +1113,8 @@ static int control_streamfile(struct ast_channel *chan,
if (!strcasecmp(end, ":end")) {
*end = '\0';
end++;
+ } else {
+ end = NULL;
}
}