cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster cman/daemon/commands.c fence/fenced/me ...
Date: 28 Aug 2007 16:51:40 -0000	[thread overview]
Message-ID: <20070828165140.9328.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rmccabe at sourceware.org	2007-08-28 16:51:39

Modified files:
	cman/daemon    : commands.c 
	fence/fenced   : member_cman.c recover.c 
	group/daemon   : joinleave.c 

Log message:
	Fix a handful of possible NULL pointer derefs

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.68&r2=1.69
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/member_cman.c.diff?cvsroot=cluster&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/recover.c.diff?cvsroot=cluster&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/joinleave.c.diff?cvsroot=cluster&r1=1.20&r2=1.21

--- cluster/cman/daemon/commands.c	2007/08/28 13:14:10	1.68
+++ cluster/cman/daemon/commands.c	2007/08/28 16:51:39	1.69
@@ -1840,7 +1840,8 @@
 	case CLUSTER_MSG_PORTSTATUS:
 		if (nodeid != us->node_id) {
 			P_MEMB("got PORTRESULT from %d, low bytes = %x %x\n", data[1], data[2]);
-			memcpy(node->port_bits, data+1, PORT_BITS_SIZE);
+			if (node)
+				memcpy(node->port_bits, data+1, PORT_BITS_SIZE);
 		}
 		break;
 
--- cluster/fence/fenced/member_cman.c	2006/12/14 19:55:24	1.16
+++ cluster/fence/fenced/member_cman.c	2007/08/28 16:51:39	1.17
@@ -199,7 +199,7 @@
 	}
 
 	/* If this call fails (though it shouldn't) then regard the node as unfenced */
-	if (cman_get_fenceinfo(ch, cn->cn_nodeid, &fence_time, &fenced, agent)) {
+	if (cn && cman_get_fenceinfo(ch, cn->cn_nodeid, &fence_time, &fenced, agent)) {
 		log_debug("cman_get_fenceinfo failed: %s", strerror(errno));
 		fenced = 0;
 	}
--- cluster/fence/fenced/recover.c	2007/02/22 16:12:42	1.27
+++ cluster/fence/fenced/recover.c	2007/08/28 16:51:39	1.28
@@ -218,9 +218,11 @@
 static inline void close_override(int *fd, char *path)
 {
 	unlink(path);
-	if (fd && *fd >= 0)
-		close(*fd);
-	*fd = -1;
+	if (fd) {
+		if (*fd >= 0)
+			close(*fd);
+		*fd = -1;
+	}
 }
 
 static int open_override(char *path)
--- cluster/group/daemon/joinleave.c	2007/08/20 14:50:30	1.20
+++ cluster/group/daemon/joinleave.c	2007/08/28 16:51:39	1.21
@@ -61,6 +61,8 @@
 	app_t *a;
 
 	a = malloc(sizeof(app_t));
+	if (!a)
+		return NULL;
 	memset(a, 0, sizeof(app_t));
 
 	a->need_first_event = 1;
@@ -94,6 +96,10 @@
 		goto out;
 
 	a = create_app(g);
+	if (!a) {
+		rv = -ENOMEM;
+		goto out;
+	}
 
 	a->client = ci;
 



             reply	other threads:[~2007-08-28 16:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-28 16:51 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-08-31 14:26 [Cluster-devel] cluster cman/daemon/commands.c fence/fenced/me rmccabe

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=20070828165140.9328.qmail@sourceware.org \
    --to=rmccabe@sourceware.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).