From 7e532280bd2dc215b40c8f90fb5dbb5525f011c9 Mon Sep 17 00:00:00 2001 From: Seth Goldberg Date: Thu, 12 Jan 2012 22:20:29 +0100 Subject: [PATCH] * grub-core/lib/arg.c (grub_arg_parse): Fix NULL pointer dereference. --- ChangeLog | 4 ++++ grub-core/lib/arg.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6aa1a8a59..62dbd3788 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-01-12 Seth Goldberg + + * grub-core/lib/arg.c (grub_arg_parse): Fix NULL pointer dereference. + 2012-01-12 Vladimir Serbinenko Fix handling of wide characters in gfxterm. diff --git a/grub-core/lib/arg.c b/grub-core/lib/arg.c index a8a508384..e6e88c461 100644 --- a/grub-core/lib/arg.c +++ b/grub-core/lib/arg.c @@ -332,7 +332,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, opt = find_long (cmd->options, arg + 2, arglen); if (!option && argv[curarg + 1] && argv[curarg + 1][0] != '-' - && opt->type != ARG_TYPE_NONE) + && opt && opt->type != ARG_TYPE_NONE) option = argv[++curarg]; if (!opt && (cmd->cmd->flags & GRUB_COMMAND_ACCEPT_DASH))