From 77846800722914eeba170505c2e7f89e12a6beff Mon Sep 17 00:00:00 2001 From: Ilya Matveychikov Date: Sat, 9 Feb 2019 18:56:17 +0400 Subject: [PATCH] fix the use of syscall result in dl_mmap --- ldso/dynlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index 206427fe..7cb66db9 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -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) -- 2.25.1