[asterisk-commits] mjordan: branch 11 r432935 - /branches/11/funcs/func_env.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 13 20:21:01 CDT 2015


Author: mjordan
Date: Fri Mar 13 20:21:00 2015
New Revision: 432935

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432935
Log:
FILE: fix retrieval of file contents when offset is specified

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)

Modified:
    branches/11/funcs/func_env.c

Modified: branches/11/funcs/func_env.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/funcs/func_env.c?view=diff&rev=432935&r1=432934&r2=432935
==============================================================================
--- branches/11/funcs/func_env.c (original)
+++ branches/11/funcs/func_env.c Fri Mar 13 20:21:00 2015
@@ -561,7 +561,7 @@
 
 			/* 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);




More information about the asterisk-commits mailing list