aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-10 12:47:14 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-13 12:26:59 -0700
commit87befcd31d6c93d8fdd7e143b66f834280b69228 (patch)
tree38a448fc2874b0767bd3768707ba4dcf5d8b1079 /memdisk
parenta122a2566e59c342afa697e442a8c9a8c381b24e (diff)
downloadsyslinux.git-87befcd31d6c93d8fdd7e143b66f834280b69228.tar.gz
syslinux.git-87befcd31d6c93d8fdd7e143b66f834280b69228.tar.xz
syslinux.git-87befcd31d6c93d8fdd7e143b66f834280b69228.zip
memdisk: make sure to ignore non-active ranges
Skip non-active ranges when looking for a suitable chunk of memory for decompression. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'memdisk')
-rw-r--r--memdisk/setup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/memdisk/setup.c b/memdisk/setup.c
index a52f136c..5fc2aa06 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -274,8 +274,8 @@ void unzip_if_needed(uint32_t *where_p, uint32_t *size_p)
int i, okmem;
/* Is it a gzip image? */
- if (check_zip ((void *)where, size, &zbytes, &gzdatasize,
- &orig_crc, &offset) == 0) {
+ if (check_zip((void *)where, size, &zbytes, &gzdatasize,
+ &orig_crc, &offset) == 0) {
if (offset + zbytes > size) {
/* Assertion failure; check_zip is supposed to guarantee this
@@ -294,10 +294,13 @@ void unzip_if_needed(uint32_t *where_p, uint32_t *size_p)
/* Must be memory */
if ( ranges[i].type != 1 )
continue;
+ if (!(ranges[i].extattr & 1))
+ continue;
/* Range start */
if ( ranges[i].start >= 0xFFFFFFFF )
continue;
+
startrange = (uint32_t)ranges[i].start;
/* Range end (0 for end means 2^64) */