Bug#474931: grub-common: update-grub segfaults

Robert Millan rmh at aybabtu.com
Tue May 6 11:05:49 UTC 2008


On Sat, May 03, 2008 at 06:30:05PM +0300, Sami Liedes wrote:
> On Wed, Apr 30, 2008 at 11:19:25PM +0200, Robert Millan wrote:
> > On Sun, Apr 20, 2008 at 11:20:56PM +0300, Sami Liedes wrote:
> > > 
> > > The problem is still the same, one grub_strstr() that you missed:
> > > [...]
> > > 315
> > > 316       p = grub_strstr (q, "id = \"") + sizeof ("id = \"") - 1;
> > 
> > Ok, let's see if we get it right this time.  Please, could you test the
> > attached patch?
> 
> Not quite, now the problem is that vg_list gets freed at fail4:.
> 
> Adding a "return 0;" before the fail4 label solves this problem (i.e.
> no crash), however I'm not sure it does what you intended then, this
> function is too long for me to grok quickly :)
> 
> > @@ -548,6 +548,10 @@ grub_lvm_scan_device (const char *name)
> >  	  }
> >        }
> 
> ADD HERE: return 0;

This should be a "goto fail2".  Can you confirm this works?

> > + fail4:
> > +  grub_free (vg);
> > + fail3:
> > +  grub_free (vgname);
> >   fail2:
> >    grub_free (metadatabuf);
> >   fail:

Thanks

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)





More information about the Pkg-grub-devel mailing list