]> granicus.if.org Git - p11-kit/commitdiff
compat: Check return value of mmap() properly
authorStef Walter <stef@thewalter.net>
Mon, 26 Aug 2013 12:48:22 +0000 (14:48 +0200)
committerStef Walter <stef@thewalter.net>
Wed, 28 Aug 2013 08:55:40 +0000 (10:55 +0200)
https://bugs.freedesktop.org/show_bug.cgi?id=68525

common/compat.c

index e7bee3ccc78a1ee8977fa9b1869e0e0707ac5f78..d81323629de05e5fd34fdf4b17082569d85cab78 100644 (file)
@@ -206,7 +206,7 @@ p11_mmap_open (const char *path,
 
        map->size = sb.st_size;
        map->data = mmap (NULL, map->size, PROT_READ, MAP_PRIVATE, map->fd, 0);
-       if (data == NULL) {
+       if (map->data == NULL) {
                close (map->fd);
                free (map);
                return NULL;