Skip to content
Snippets Groups Projects
  • Matthew Jordan's avatar
    73dcea59
    funcs/func_env: Fix regression caused in FILE read operation · 73dcea59
    Matthew Jordan authored
    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
    ........
    
    Merged revisions 433173 from http://svn.asterisk.org/svn/asterisk/branches/11
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
    73dcea59
    History
    funcs/func_env: Fix regression caused in FILE read operation
    Matthew Jordan authored
    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
    ........
    
    Merged revisions 433173 from http://svn.asterisk.org/svn/asterisk/branches/11
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433174 65c4cc65-6c06-0410-ace0-fbb531ad65f3