瀏覽代碼

defect 741
saCkptCheckpointOpenAsync doesn't return error when
checkpointSize > maxSections * maxSectionsSize


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@759 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 21 年之前
父節點
當前提交
461da3d514
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      lib/ckpt.c

+ 6 - 0
lib/ckpt.c

@@ -626,6 +626,12 @@ saCkptCheckpointOpenAsync (
 	if (((checkpointOpenFlags & SA_CKPT_CHECKPOINT_CREATE) == 0) && 
 		checkpointCreationAttributes != NULL) {
 
+		failWithError = SA_AIS_ERR_INVALID_PARAM;
+	} else
+	if (checkpointCreationAttributes &&
+		(checkpointCreationAttributes->checkpointSize >
+		(checkpointCreationAttributes->maxSections * checkpointCreationAttributes->maxSectionSize))) {
+
 		failWithError = SA_AIS_ERR_INVALID_PARAM;
 	}