commit d05d841: [Fix] Mmap return value must be checked versus MAP_FAILED

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Sep 17 22:35:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-17 23:26:05 +0100
URL: https://github.com/rspamd/rspamd/commit/d05d841321b6889b035327caa71f10084130ca4a

[Fix] Mmap return value must be checked versus MAP_FAILED
Issue: #3459

---
 contrib/lua-lpeg/lpvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lua-lpeg/lpvm.c b/contrib/lua-lpeg/lpvm.c
index 3e67fcaf0..7ee8b695a 100644
--- a/contrib/lua-lpeg/lpvm.c
+++ b/contrib/lua-lpeg/lpvm.c
@@ -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 ++) {


More information about the Commits mailing list