From 788f1f3a85e3b369124cc698f7979b73819a656b Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 12 Sep 2010 13:50:24 +0200 Subject: [PATCH 1/3] * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_reset): Preserve context pointer. --- ChangeLog | 5 +++++ grub-core/lib/xzembed/xz_dec_stream.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 330656cc3..f82f12467 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-09-11 Vladimir Serbinenko + + * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_reset): Preserve context + pointer. + 2010-09-11 Szymon Janc * grub-core/commands/lsacpi.c (grub_cmd_lsacpi): Fix prototype. diff --git a/grub-core/lib/xzembed/xz_dec_stream.c b/grub-core/lib/xzembed/xz_dec_stream.c index 642492483..ff26f5119 100644 --- a/grub-core/lib/xzembed/xz_dec_stream.c +++ b/grub-core/lib/xzembed/xz_dec_stream.c @@ -830,8 +830,15 @@ void xz_dec_reset(struct xz_dec *s) s->allow_buf_error = false; s->pos = 0; - memzero(&s->block, sizeof(s->block)); - memzero(&s->index, sizeof(s->index)); + { + uint8_t *t; + t = s->block.hash.crc32_context; + memzero(&s->block, sizeof(s->block)); + s->block.hash.crc32_context = t; + t = s->index.hash.crc32_context; + memzero(&s->index, sizeof(s->index)); + s->index.hash.crc32_context = t; + } s->temp.pos = 0; s->temp.size = STREAM_HEADER_SIZE; From faca6bec3b87b5973998ed44bbc42e7273e491ab Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 12 Sep 2010 13:53:12 +0200 Subject: [PATCH 2/3] * grub-core/commands/menuentry.c (append_menu_entry): Don't rely on args ending with NULL. --- ChangeLog | 7 ++++++- grub-core/commands/menuentry.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f82f12467..79fd79556 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2010-09-11 Vladimir Serbinenko +2010-09-12 Vladimir Serbinenko + + * grub-core/commands/menuentry.c (append_menu_entry): Don't rely on + args ending with NULL. + +2010-09-12 Vladimir Serbinenko * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_reset): Preserve context pointer. diff --git a/grub-core/commands/menuentry.c b/grub-core/commands/menuentry.c index fc1ae71c7..c28c6ef6f 100644 --- a/grub-core/commands/menuentry.c +++ b/grub-core/commands/menuentry.c @@ -128,7 +128,7 @@ append_menu_entry (int argc, const char **args, char **classes, if (! menu_args) goto fail; - for (i = 0; args[i]; i++) + for (i = 0; i < argc; i++) { menu_args[i] = grub_strdup (args[i]); if (! menu_args[i]) From 4870900f8fa000335070852a917c85c68aae664a Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 12 Sep 2010 13:55:52 +0200 Subject: [PATCH 3/3] * grub-core/kern/emu/main.c (main): Call hostfs_init only after init_all. --- ChangeLog | 4 ++++ grub-core/kern/emu/main.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 79fd79556..436c0980b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-09-12 Vladimir Serbinenko + + * grub-core/kern/emu/main.c (main): Call hostfs_init only after init_all. + 2010-09-12 Vladimir Serbinenko * grub-core/commands/menuentry.c (append_menu_entry): Don't rely on diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c index 23b8516f1..c575beb4b 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c @@ -190,13 +190,14 @@ main (int argc, char *argv[]) grub_emu_init (); grub_console_init (); grub_host_init (); - grub_hostfs_init (); /* XXX: This is a bit unportable. */ grub_util_biosdisk_init (dev_map); grub_init_all (); + grub_hostfs_init (); + grub_emu_post_init (); /* Make sure that there is a root device. */