diff --git a/arch/x86/stage1.c b/arch/x86/stage1.c index d61721b7fb..3265741c72 100644 --- a/arch/x86/stage1.c +++ b/arch/x86/stage1.c @@ -101,7 +101,7 @@ void stage1_main(u32 bist) // FIXME this should be defined in the VPD area // but NOT IN THE CODE. - archive.len=(CONFIG_LINUXBIOS_ROMSIZE_KB-16)*1024; + archive.len=(CONFIG_LINUXBIOS_ROMSIZE_KB)*1024; archive.start=(void *)(0UL-(CONFIG_LINUXBIOS_ROMSIZE_KB*1024)); // FIXME check integrity diff --git a/lib/lar.c b/lib/lar.c index 6fedc4111e..108482b6ad 100644 --- a/lib/lar.c +++ b/lib/lar.c @@ -40,7 +40,7 @@ int find_file(struct mem_file *archive, char *filename, struct mem_file *result) archive->len); for (walk = archive->start; - walk < (char *)archive->start + archive->len - 1; walk += 16) { + (walk - 1) < (char *)(archive->start + archive->len - 1 ); walk += 16) { if (strcmp(walk, MAGIC) != 0) continue;