]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Check for the proper return value on an error in a call to mmap().
authorRussell Bryant <russell@russellbryant.com>
Sun, 24 Dec 2006 07:23:07 +0000 (07:23 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sun, 24 Dec 2006 07:23:07 +0000 (07:23 +0000)
This was reported by Andy Wang on the asterisk-dev list.  Thanks!

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

channels/chan_iax2.c

index e896abeb3eab4d7c4200fcc6237fa9bd3a626533..1adac13e272956550784855eccf75af407a8fc6d 100644 (file)
@@ -1260,7 +1260,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;