From 2551bbd00a98ef83d6643152832cb3e45cfdf22b Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Wed, 13 Jul 2005 20:10:02 +0000 Subject: [PATCH] defect 711 if no active replica set in checkpoint write, error not returned git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@749 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/ckpt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/exec/ckpt.c b/exec/ckpt.c index e1614b3f..636dcc32 100644 --- a/exec/ckpt.c +++ b/exec/ckpt.c @@ -2393,6 +2393,16 @@ static int message_handler_req_exec_ckpt_sectionwrite (void *message, struct in_ error = SA_AIS_ERR_NOT_EXIST; goto error_exit; } + if (ckptCheckpoint->active_replica_set == 0) { + log_printf (LOG_LEVEL_NOTICE, "checkpointwrite: no active replica, returning error.\n"); + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } + + if (ckptCheckpoint->checkpointCreationAttributes.maxSectionSize < req_lib_ckpt_sectionwrite->dataSize) { + error = SA_AIS_ERR_INVALID_PARAM; + goto error_exit; + } /* printf ("writing checkpoint section is %s\n", ((char *)req_lib_ckpt_sectionwrite) + sizeof (struct req_lib_ckpt_sectionwrite));