fix the use of syscall result in dl_mmap

This commit is contained in:
Ilya Matveychikov 2019-02-09 18:56:17 +04:00 committed by Rich Felker
parent e8e780af98
commit 7784680072
1 changed files with 1 additions and 1 deletions

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)