* [Cluster-devel] cluster cman/daemon/commands.c fence/fenced/me ...
@ 2007-08-28 16:51 rmccabe
0 siblings, 0 replies; 2+ messages in thread
From: rmccabe @ 2007-08-28 16:51 UTC (permalink / raw)
To: cluster-devel.redhat.com
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;
^ permalink raw reply [flat|nested] 2+ messages in thread* [Cluster-devel] cluster cman/daemon/commands.c fence/fenced/me ...
@ 2007-08-31 14:26 rmccabe
0 siblings, 0 replies; 2+ messages in thread
From: rmccabe @ 2007-08-31 14:26 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rmccabe at 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-31 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-28 16:51 [Cluster-devel] cluster cman/daemon/commands.c fence/fenced/me rmccabe
-- strict thread matches above, loose matches on Subject: below --
2007-08-31 14:26 rmccabe
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).