The loop that reads in a file was not correctly using the offset when
determining what bytes to append to the output. This patch corrects
the logic such that the correct portion of the file is extracted when an
offset is specified.
ASTERISK-21765
Reported by: John Zhong
Tested by: Matt Jordan, Di-Shi Sun
patches:
file_read_390821.patch uploaded by Di-Shi Sun (License 5076)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@432935
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
/* Don't go past the length requested */
if (off_i + toappend > offset + length) {
- toappend = length - off_i;
+ toappend = offset + length - off_i;
}
ast_str_append_substr(buf, len, fbuf, toappend);