Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=3d3bfb818b7332... Commit: 3d3bfb818b7332fe223aa534f52714a9026f1ea6 Parent: 33dedabacbdb48acd8a44abab88e6c2280fc9988 Author: Ryan McCabe rmccabe@redhat.com AuthorDate: Fri Jul 12 15:46:27 2013 -0400 Committer: Ryan McCabe rmccabe@redhat.com CommitterDate: Mon Jul 22 13:01:12 2013 -0400
rgmanager: Fix unlikely NULL ptr deref
Fix a couple of places where a very unlikely null pointer dereference could occur.
Related: rhbz#968322
Signed-off-by: Ryan McCabe rmccabe@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 02b5bce..88a5eef 100644 --- a/rgmanager/src/clulib/vft.c +++ b/rgmanager/src/clulib/vft.c @@ -525,6 +525,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? */ @@ -809,6 +812,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; }