[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in arg.c
From: |
Seth Goldberg |
Subject: |
Bug in arg.c |
Date: |
Wed, 4 Jan 2012 19:02:01 -0800 (PST) |
User-agent: |
Alpine 2.00 (GSO 1167 2008-08-23) |
Hi,
If you supply an invalid long option with an argument, null pointer
dereference will result. The fix is simple:
--- a/grub-core/lib/arg.c Wed Jan 04 17:38:56 2012 -0800
+++ b/grub-core/lib/arg.c Wed Jan 04 18:59:08 2012 -0800
@@ -351,7 +351,7 @@
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))
- Bug in arg.c,
Seth Goldberg <=