grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

extract_legacy_entries_source hoses system when menu.lst can't be opened


From: Seth Goldberg
Subject: extract_legacy_entries_source hoses system when menu.lst can't be opened
Date: Fri, 27 Jan 2012 22:04:48 -0800 (PST)
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)

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 ();






reply via email to

[Prev in Thread] Current Thread [Next in Thread]