[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster cman/daemon/commands.c fence/fenced/me ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	rmccabe sourceware org	2007-08-31 14:26:04

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

Log message:
	fix 267441: Possible NULL pointer deferences in cman

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.8&r2=1.55.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/member_cman.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.1&r2=1.15.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/recover.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.25.2.2&r2=1.25.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/joinleave.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.19&r2=1.19.2.1

--- cluster/cman/daemon/commands.c	2007/06/26 12:29:17	1.55.2.8
+++ cluster/cman/daemon/commands.c	2007/08/31 14:26:04	1.55.2.9
@@ -1805,7 +1805,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:49	1.15.2.1
+++ cluster/fence/fenced/member_cman.c	2007/08/31 14:26:04	1.15.2.2
@@ -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/01/29 20:30:25	1.25.2.2
+++ cluster/fence/fenced/recover.c	2007/08/31 14:26:04	1.25.2.3
@@ -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	2006/10/13 20:07:45	1.19
+++ cluster/group/daemon/joinleave.c	2007/08/31 14:26:04	1.19.2.1
@@ -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;
@@ -90,6 +92,10 @@
 		goto out;
 
 	a = create_app(g);
+	if (!a) {
+		rv = -ENOMEM;
+		goto out;
+	}
 
 	a->client = ci;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]