linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Buell <alex.buell@munted.org.uk>
To: Theodore Tso <tytso@mit.edu>
Cc: Thierry Vignaud <tvignaud@mandriva.com>,
	Eric Sandeen <sandeen@redhat.com>,
	ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] debugfs: don't try to fclose NULL
Date: Tue, 30 Jun 2009 17:46:23 +0100	[thread overview]
Message-ID: <1246380383.11440.2.camel@lithium.local.net> (raw)
In-Reply-To: <20090630163956.GE7398@mit.edu>

On Tue, 2009-06-30 at 12:39 -0400, Theodore Tso wrote:
> On Tue, Jun 30, 2009 at 05:44:55PM +0200, Thierry Vignaud wrote:
> > Eric Sandeen <sandeen@redhat.com> writes:
> > 
> > > do_logdump may jump to errout if fopen(out_file) fails, 
> > > but in that case out_file is NULL, and fclose will segfault.
> > 
> > You should report that segfault to glibc authors too.
> 
> It would be robust for glibc to code fclose() defensively such that it
> would survive a null pointer, but I don't think it's technically
> required by the ANSI or POSIX spec.

It's the programmer's responsibility to write the following:

if (fp)
	fclose(fp);

-- 
http://www.munted.org.uk

One very high maintenance cat living here.

      reply	other threads:[~2009-06-30 17:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26 18:57 [PATCH] debugfs: don't try to fclose NULL Eric Sandeen
2009-06-29  5:07 ` Theodore Tso
2009-06-30 15:44 ` Thierry Vignaud
2009-06-30 16:39   ` Theodore Tso
2009-06-30 16:46     ` Alex Buell [this message]

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=1246380383.11440.2.camel@lithium.local.net \
    --to=alex.buell@munted.org.uk \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=tvignaud@mandriva.com \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).