All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan McCabe <rmccabe@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 5/5] rgmanager: Fix a possible NULL pointer dereference
Date: Thu, 28 Jun 2012 15:58:13 -0400	[thread overview]
Message-ID: <20120628195810.GA80026@redhat.com> (raw)

Fix a NULL pointer dereference that could happen when cman_get_node_count()
returns 0 with errno set to EINTR.

Possibly resolves rhbz#820632

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
---
 rgmanager/src/clulib/members.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rgmanager/src/clulib/members.c b/rgmanager/src/clulib/members.c
index f705297..72f4529 100644
--- a/rgmanager/src/clulib/members.c
+++ b/rgmanager/src/clulib/members.c
@@ -367,8 +367,10 @@ get_member_list(cman_handle_t h)
 
 	do {	
 		++tries;
-		if (nodes)
+		if (nodes) {
 			free(nodes);
+			nodes = NULL;
+		}
 
 		c = cman_get_node_count(h);
 		if (c <= 0) {
-- 
1.7.10.2



             reply	other threads:[~2012-06-28 19:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28 19:58 Ryan McCabe [this message]
2012-07-04 11:07 ` [Cluster-devel] [PATCH 5/5] rgmanager: Fix a possible NULL pointer dereference Fabio M. Di Nitto

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=20120628195810.GA80026@redhat.com \
    --to=rmccabe@redhat.com \
    /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.