[PATCH 7/8] Cygwin: Handle excluded regions more robustly in dumper

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


Avoid trying to create regions with negative size if there's an error
(duplicate or out-of-order region) in the excluded region list.
---
 winsup/utils/dumper.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc
index ccc4bd12f..c0b3fd8ff 100644
--- a/winsup/utils/dumper.cc
+++ b/winsup/utils/dumper.cc
@@ -252,6 +252,9 @@ dumper::split_add_mem_region (LPBYTE base, SIZE_T size)
 	  continue;
 	}
 
+      if (p->base < last_base)
+	continue;
+
       add_mem_region (last_base, p->base - last_base);
       last_base = p->base + p->size;
     }
-- 
2.27.0



More information about the Cygwin-patches mailing list