From: Russell Bryant Date: Thu, 7 Dec 2006 18:14:13 +0000 (+0000) Subject: Ensure that the file position is not incremented beyond the total number of X-Git-Tag: 1.2.14~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d79533bd94ebe1782accaf6ce1090d5e2a1e526d;p=thirdparty%2Fasterisk.git Ensure that the file position is not incremented beyond the total number of files available for playback. (issue #8539, ulogic) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@48356 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index ccc6182578..c7f1fff6a2 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -227,6 +227,7 @@ static int ast_moh_files_next(struct ast_channel *chan) if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) { ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", state->class->filearray[state->pos], strerror(errno)); state->pos++; + state->pos %= state->class->total_files; return -1; }