From 875b5db17bbedaeed7044bd81494d72f43f7a545 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 19 Jul 2006 15:06:16 +0200 Subject: [PATCH] preloader: Make sure the WINEPRELOADRESERVE area doesn't overlap the low memory area. --- loader/preloader.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/loader/preloader.c b/loader/preloader.c index 274d8580411..d9b749c8549 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -847,6 +847,12 @@ static void preload_reserve( const char *str ) start = end = NULL; } + /* check for overlap with low memory area */ + if ((char *)end <= (char *)preload_info[0].addr + preload_info[0].size) + start = end = NULL; + else if ((char *)start < (char *)preload_info[0].addr + preload_info[0].size) + start = (char *)preload_info[0].addr + preload_info[0].size; + /* entry 2 is for the PE exe */ preload_info[2].addr = start; preload_info[2].size = (char *)end - (char *)start;