Fix handling of negative return code when storing voicemails in ODBC storage
authorMatthew Jordan <mjordan@digium.com>
Mon, 16 Apr 2012 21:42:12 +0000 (21:42 +0000)
committerMatthew Jordan <mjordan@digium.com>
Mon, 16 Apr 2012 21:42:12 +0000 (21:42 +0000)
commitebcccf8997764b3aa84d36112ae8380703e1d053
treebc8ff4550fa13b18f61bcf93f5f86246800fabcb
parentabf40d9b28c0fc8339643e2903692e154d32719e
Fix handling of negative return code when storing voicemails in ODBC storage

When storing a voicemail message using an ODBC connection to a database, the
voicemail message is first stored on disk.  The sound file associated with
the message is read into memory before being transmitted to the database.
When this occurs, a failure in the C library's lseek function would cause a
negative value to be passed to the mmap as the size of the memory map to
create.  This would almost certainly cause the creation of the memory map to
fail, resulting in the message being lost.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_voicemail.c