Merged revisions 48944 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Sun, 24 Dec 2006 07:27:29 +0000 (07:27 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sun, 24 Dec 2006 07:27:29 +0000 (07:27 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48944 | russell | 2006-12-24 02:25:38 -0500 (Sun, 24 Dec 2006) | 11 lines

Merged revisions 48943 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48943 | russell | 2006-12-24 02:23:07 -0500 (Sun, 24 Dec 2006) | 3 lines

Check for the proper return value on an error in a call to mmap().
This was reported by Andy Wang on the asterisk-dev list.  Thanks!

........

................

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

channels/chan_iax2.c

index 6456f46..dda1e68 100644 (file)
@@ -1469,7 +1469,7 @@ static int try_firmware(char *s)
                return -1;
        }
        fwh = mmap(NULL, stbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); 
-       if (!fwh) {
+       if (fwh == (void *) -1) {
                ast_log(LOG_WARNING, "mmap failed: %s\n", strerror(errno));
                close(fd);
                return -1;