* grub-core/script/execute.c (grub_script_return): Fix potential
NULL-dereference. Reported by: Jim Meyering.
This commit is contained in:
parent
498453f661
commit
ac576cde1d
2 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2012-02-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/script/execute.c (grub_script_return): Fix potential
|
||||||
|
NULL-dereference.
|
||||||
|
Reported by: Jim Meyering.
|
||||||
|
|
||||||
2012-02-03 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-02-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* po/POTFILES.in: Regenerate.
|
* po/POTFILES.in: Regenerate.
|
||||||
|
|
|
@ -161,8 +161,12 @@ grub_script_return (grub_command_t cmd __attribute__((unused)),
|
||||||
|
|
||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
{
|
{
|
||||||
|
char *t;
|
||||||
function_return = 1;
|
function_return = 1;
|
||||||
return grub_strtoul (grub_env_get ("?"), NULL, 10);
|
t = grub_env_get ("?");
|
||||||
|
if (!t)
|
||||||
|
return GRUB_ERR_NONE;
|
||||||
|
return grub_strtoul (t, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
n = grub_strtoul (argv[0], &p, 10);
|
n = grub_strtoul (argv[0], &p, 10);
|
||||||
|
|
Loading…
Reference in a new issue