Fix places where a negative return from ftello could be used as invalid input
authorMatthew Jordan <mjordan@digium.com>
Tue, 17 Apr 2012 20:59:25 +0000 (20:59 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 17 Apr 2012 20:59:25 +0000 (20:59 +0000)
commit2cc415417e722bdf360a63935f0beb24fb8fc047
tree0e212f4767768d7eafdb315082c21c523af0adba
parentfc63e07135d645af0df8d393aa84c0ae3b7e1924
Fix places where a negative return from ftello could be used as invalid input

In a variety of locations in both reading and writing a file, the result
from the C library function ftello is used as input to other functions.  For
the parameters and functions in question, a negative value is invalid input.
This patch checks the return value from the ftello function to determine if
we were able to determine the current position in the file stream and, if not,
fail gracefully.

(issue ASTERISK-19655)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/1863/
........

Merged revisions 362355 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362356 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
funcs/func_env.c