]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix places in main where a negative return value could impact execution
authorMatthew Jordan <mjordan@digium.com>
Tue, 17 Apr 2012 21:07:29 +0000 (21:07 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 17 Apr 2012 21:07:29 +0000 (21:07 +0000)
commitecb1323ef1ae52d6e314d6d7356e528b518408be
tree4096bcba4a6f48df51fd1323aaac613d3b631219
parent4f4439047ac15f4e799cd96daafa26cf1eb7d9f1
Fix places in main where a negative return value could impact execution

This patch addresses a number of modules in main that did not handle the
negative return value from function calls adequately, or were not sufficiently
clear that the conditions leading to improper handling of the return values
could not occur.  This includes:

* asterisk.c: A negative return value from the read function would be used
directly as an index into a buffer.  We now check for success of the read
function prior to using its result as an index.

* manager.c: Check for failures in mkstemp and lseek when handling the
temporary file created for processing data returned from a CLI command in
action_command.  Also check that the result of an lseek is sanitized prior
to using it as the size of a memory map to allocate.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@362360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/asterisk.c
main/manager.c