fix the use of syscall result in dl_mmap

This commit is contained in:
Ilya Matveychikov
2019-04-06 09:38:49 -04:00
committed by Rich Felker
parent e8e780af98
commit 7784680072
+1 -1
View File
@@ -920,7 +920,7 @@ static void *dl_mmap(size_t n)
#else
p = (void *)__syscall(SYS_mmap, 0, n, prot, flags, -1, 0);
#endif
return p == MAP_FAILED ? 0 : p;
return (unsigned long)p > -4096UL ? 0 : p;
}
static void makefuncdescs(struct dso *p)