[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
Changes by:	rmccabe 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;
 


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