[asterisk-commits] tilghman: branch 1.4 r47863 - in /branches/1.4: ./ apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Nov 20 13:00:55 MST 2006


Author: tilghman
Date: Mon Nov 20 14:00:54 2006
New Revision: 47863

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47863
Log:
Merged revisions 47862 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47862 | tilghman | 2006-11-20 13:59:07 -0600 (Mon, 20 Nov 2006) | 2 lines

Failing to trap -1 error from mmap causes segfault (Issue 8385)

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/apps/app_voicemail.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=47863&r1=47862&r2=47863
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Mon Nov 20 14:00:54 2006
@@ -1098,8 +1098,13 @@
 						fd = -1;
 						continue;
 					}
-					if (fd > -1)
-						fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+					if (fd > -1) {
+						if ((fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == -1) {
+							ast_log(LOG_WARNING, "Could not mmap the output file: %s (%d)\n", strerror(errno), errno);
+							SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+							goto yuck;
+						}
+					}
 				}
 				if (fdm) {
 					memset(fdm, 0, fdlen);



More information about the asterisk-commits mailing list