From 1dd95fcb8bb9b5feeabee0dfe334448733f5cb4c Mon Sep 17 00:00:00 2001 From: Serge van den Boom Date: Sun, 5 Apr 2009 19:00:18 -0400 Subject: [PATCH] Correctly handle mmap() failure (#21062) --- src/fccache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fccache.c b/src/fccache.c index 63319f6..69e1a6b 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -553,6 +553,8 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat) { #if defined(HAVE_MMAP) || defined(__CYGWIN__) cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0); + if (cache == MAP_FAILED) + cache = NULL; #elif defined(_WIN32) { HANDLE hFileMap; -- 2.39.5