All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in arg.c
@ 2012-01-05  3:02 Seth Goldberg
  2012-01-12 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Seth Goldberg @ 2012-01-05  3:02 UTC (permalink / raw)
  To: grub-devel

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-12 21:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-05  3:02 Bug in arg.c Seth Goldberg
2012-01-12 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.