Skip to content
Snippets Groups Projects
Commit 1e130f92 authored by Matthew Jordan's avatar Matthew Jordan
Browse files

funcs/func_env: Fix regression caused in FILE read operation

When r432935 was merged, it did correctly fix a situation where a FILE read
operation on the middle of a file buffer would not read the requested length
in the parameters passed to the FILE function. Unfortunately, it would also
allow the FILE function to append more bytes than what was available in the
buffer if the length exceeded the end of the buffer length.

This patch takes the minimum of the remaining bytes in the buffer along with
the calculated length to append provided by the original patch, and uses
that as the length to append in the return result. This patch also updates
the unit tests with the scenarios that were originally pointed out in
ASTERISK-21765 that the original implementation treated incorrectly.

ASTERISK-21765


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 485e0538
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment