]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Mmap return value must be checked versus MAP_FAILED
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 17 Sep 2020 22:26:05 +0000 (23:26 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 17 Sep 2020 22:26:05 +0000 (23:26 +0100)
Issue: #3459

contrib/lua-lpeg/lpvm.c

index 3e67fcaf04b7552653f69690a32f2068b1bae7be..7ee8b695a70f7aaa1ca6d1d5f019dce2b8fa8609 100644 (file)
@@ -73,7 +73,7 @@ lpeg_allocate_mem_low (size_t sz)
 
        cp = mmap (base_addr, sz + sizeof (sz), PROT_WRITE | PROT_READ,
                        flags, -1, 0);
-       assert (cp != NULL);
+       assert (cp != MAP_FAILED);
        memcpy (cp, &sz, sizeof (sz));
 
        for (unsigned i = 0; i < MAX_PIECES; i ++) {