From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: gazillon of double-free
Date: Thu, 09 Sep 2010 01:44:08 +0200 [thread overview]
Message-ID: <4C881FC8.7020208@gmail.com> (raw)
In-Reply-To: <AANLkTim+rNts0NA=wETVz1V5WhpYoNrnwD-DeDttUWY+@mail.gmail.com>
On 09/09/10 01:20, Robert Millan wrote:
> It seems we have a ton of double-free bugs in label() and
> uuid() routines.
>
> Take for example grub_ext2_label():
>
> data = grub_ext2_mount (disk);
> if (data)
> *label = grub_strndup (data->sblock.volume_name, 14);
> else
> *label = NULL;
> grub_free (data);
>
> If grub_ext2_mount fails, data is not allocated but we free it anyway.
>
> Or perhaps I'm missing something? (it's late here, I need some sleep)
>
>
grub_free (NULL) is a no-op on purpose:
/* Deallocate the pointer PTR. */
void
grub_free (void *ptr)
{
grub_mm_header_t p;
grub_mm_region_t r;
if (! ptr)
return;
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
next prev parent reply other threads:[~2010-09-08 23:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-08 23:20 gazillon of double-free Robert Millan
2010-09-08 23:44 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2010-09-14 19:42 ` Colin D Bennett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C881FC8.7020208@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.