bug-gnulib
[Top][All Lists]
Advanced

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

Re: Bug#612692: grub-setup segfaults when presented with partitioned rai


From: Jim Meyering
Subject: Re: Bug#612692: grub-setup segfaults when presented with partitioned raid
Date: Fri, 11 Feb 2011 10:40:56 +0100

Colin Watson wrote:
> On Wed, Feb 09, 2011 at 03:33:54PM -0800, Jamie Heilman wrote:
>> address@hidden:/etc/grub.d# grub-setup --directory=/boot/grub
>> --device-map=/boot/grub/device.map /dev/md/d0
>> Invalid device `/dev/md/d0'.
>> Segmentation fault
>>
>> I think that was supposed to show usage ... not segfault.
>
> I've tracked this down to a bug in Gnulib.  It's reproducible using the
> attached test file in a scratch project with the argp module.

Hi Colin,

Thanks for the patch.
That fix looks right, but let's wait for Sergey to reply.

You mention an attachment, but I see none.
Did you consider adding a new test to tests/test-argp.c?

FWIW, your patch applies also to glibc sources.

> I suggest the following patch:
>
>>From 5171cd55e535fef406e8f170f648723655933e53 Mon Sep 17 00:00:00 2001
> From: Colin Watson <address@hidden>
> Date: Thu, 10 Feb 2011 00:31:44 +0000
> Subject: [PATCH] argp: Fix argp_help segfault with help filter
>
> * lib/argp-parse.c (__argp_input): Test state->pstate as well as state.
> ---
>  lib/argp-parse.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/lib/argp-parse.c b/lib/argp-parse.c
> index c884b89..44ce7d1 100644
> --- a/lib/argp-parse.c
> +++ b/lib/argp-parse.c
> @@ -935,7 +935,7 @@ weak_alias (__argp_parse, argp_parse)
>  void *
>  __argp_input (const struct argp *argp, const struct argp_state *state)
>  {
> -  if (state)
> +  if (state && state->pstate)
>      {
>        struct group *group;
>        struct parser *parser = state->pstate;
> --
> 1.7.2.3
>
> Thanks,



reply via email to

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