[PATCH 6/8] Cygwin: Fix dumper region order/overlap checking

Jon Turney jon.turney@dronecode.org.uk
Wed Jul 1 21:25:27 GMT 2020


---
 winsup/utils/parse_pe.cc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/winsup/utils/parse_pe.cc b/winsup/utils/parse_pe.cc
index d2a510a81..653c46dfe 100644
--- a/winsup/utils/parse_pe.cc
+++ b/winsup/utils/parse_pe.cc
@@ -60,11 +60,9 @@ exclusion::sort_and_check ()
   for (process_mem_region * p = region; p < region + last - 1; p++)
     {
       process_mem_region *q = p + 1;
-      if (q == p + 1)
-	continue;
-      if (p->base + size > q->base)
+      if (p->base + p->size > q->base)
 	{
-	  fprintf (stderr, "region error @ (%p + %zd) > %p\n", p->base, size, q->base);
+	  fprintf (stderr, "region error @ (%p + 0x%0llx) > %p\n", p->base, p->size, q->base);
 	  return 0;
 	}
     }
-- 
2.27.0



More information about the Cygwin-patches mailing list