Hi there,

In grub_cmd_legacy_source, if the menu.lst file cannot opened in legacy_file(), grub_env_extractor_close() attempts to access memory at address 4, which could end up corrupting the entire menu.

The easy fix is to check if the first call to grub_env_get_menu() returns NULL and bail out (after the grub_env_context_close() and grub_extractor_level--, of course), since there's no point trying to append menu entries to the prev menu (since there are none).

 --S


--- a/grub-core/normal/context.c        Fri Jan 27 18:33:26 2012 -0800
+++ b/grub-core/normal/context.c        Fri Jan 27 22:04:05 2012 -0800
@@ -159,7 +159,7 @@
     }
   err = grub_env_context_close ();

-  if (source)
+  if (source && menu)
     {
       grub_menu_t menu2;
       menu2 = grub_env_get_menu ();




_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to