Mac OS 9's CHRP boot info is delimited by an ASCII EOT, so the bootscript loader will truncate the malloc() size if it encounters one to avoid an out-of-memory error.
Signed-off-by: Cormac O'Brien i.am.cormac.obrien@gmail.com
--- libopenbios/bootinfo_load.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/libopenbios/bootinfo_load.c b/libopenbios/bootinfo_load.c index fa9e36b..a3ce00e 100644 --- a/libopenbios/bootinfo_load.c +++ b/libopenbios/bootinfo_load.c @@ -161,6 +161,15 @@ bootinfo_init_program(void) feval("load-size"); size = POP();
+ current = 0; + while (current < size) { + if (base[current] == 0x04) { + size = current; + break; + } + current++; + } + bootscript = malloc(size); if (bootscript == NULL) { DPRINTF("Can't malloc %d bytes\n", size);