Gitweb:
http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=e1aee22c385...
Commit: e1aee22c3853cb218e351c73d44448722a805d68
Parent: 842398a32b2a74631c0a350a3c06794b91e7c34c
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Fri Jul 12 15:46:27 2013 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Wed Jul 17 10:49:05 2013 -0400
rgmanager: Fix unlikely NULL ptr deref
Fix a couple of places where a very unlikely null pointer
dereference could occur.
Related: rhbz#983296
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/clulib/vft.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/clulib/vft.c b/rgmanager/src/clulib/vft.c
index ad1f468..80f1e86 100644
--- a/rgmanager/src/clulib/vft.c
+++ b/rgmanager/src/clulib/vft.c
@@ -498,6 +498,9 @@ vf_buffer_join_msg(vf_msg_t *hdr, struct timeval *timeout)
hdr->vm_msg.vf_view,
hdr->vm_msg.vf_data, hdr->vm_msg.vf_datalen);
+ if (!newp)
+ return 0;
+
if (timeout && (timeout->tv_sec || timeout->tv_usec)) {
if (getuptime(&newp->vn_timeout) == -1) {
/* XXX What do we do here? */
@@ -782,6 +785,7 @@ vf_try_commit(key_node_t *key_node)
*/
if (key_node->kn_data == NULL) {
fprintf (stderr, "malloc fail err=%d\n", errno);
+ key_node->kn_datalen = 0;
return -1;
}