From d86bd35298834f3162459dde763f7976f5c2a523 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 22 Apr 2018 11:55:36 +0100 Subject: libdl: end must be bigger than start --- ldso/libdl/libdl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index ff2753591..d36ac6421 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -967,7 +967,8 @@ static int do_dlclose(void *vhandle, int need_fini) end = (end + ADDR_ALIGN) & PAGE_ALIGN; start = start & ~ADDR_ALIGN; _dl_if_debug_print("unmapping: %s start: '%p' end: '%p'\n", tpnt->libname, start, end); - DL_LIB_UNMAP (tpnt, end - start); + if (end > start) + DL_LIB_UNMAP (tpnt, end - start); /* Free elements in RTLD_LOCAL scope list */ for (runp = tpnt->rtld_local; runp; runp = tmp) { tmp = runp->next; -- cgit v1.2.3