"terminator '%c'\n", image, *mem );
break;
}
+ exec_ctx->mem_limit -= 1;
}
return 0;
return -ENOBUFS;
}
/* Check that we are within the kernel's range */
- if ( ( address + total_len ) > exec_ctx->mem_limit )
+ if ( ( address + total_len - 1 ) > exec_ctx->mem_limit )
continue;
/* Prepare and verify segment */
if ( ( rc = prep_segment ( phys_to_user ( address ), 0,
( bzhdr.heap_end_ptr + 0x200 );
exec_ctx.vid_mode = bzhdr.vid_mode;
if ( bzhdr.version >= 0x0203 ) {
- exec_ctx.mem_limit = ( bzhdr.initrd_addr_max + 1 );
+ exec_ctx.mem_limit = bzhdr.initrd_addr_max;
} else {
- exec_ctx.mem_limit = ( BZI_INITRD_MAX + 1 );
+ exec_ctx.mem_limit = BZI_INITRD_MAX;
}
/* Parse command line for bootloader parameters */