linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 2/2] e2fsck: fix possible double free when searching for config file
Date: Fri,  3 Jan 2014 18:12:28 -0500	[thread overview]
Message-ID: <1388790748-18973-2-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1388790748-18973-1-git-send-email-tytso@mit.edu>

This happens if there is an error while scanning a directory for
config file fragments.  This is rarely used, which is why we didn't
notice this.

Addresses-Coverity-Bug: #1138576

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 e2fsck/profile.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/e2fsck/profile.c b/e2fsck/profile.c
index 92aa893..9cfab37 100644
--- a/e2fsck/profile.c
+++ b/e2fsck/profile.c
@@ -320,6 +320,7 @@ profile_init(const char **files, profile_t *ret_profile)
 	    for (fs = files; !PROFILE_LAST_FILESPEC(*fs); fs++) {
 		if (array)
 			free_list(array);
+		array = NULL;
 		retval = get_dirlist(*fs, &array);
 		if (retval == 0) {
 			if (!array)
-- 
1.8.5.rc3.362.gdf10213


      reply	other threads:[~2014-01-03 23:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03 23:12 [PATCH 1/2] debugfs: clean up read_journal_block() to avoid Coverity complaint Theodore Ts'o
2014-01-03 23:12 ` Theodore Ts'o [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=1388790748-18973-2-git-send-email-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.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 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).