Просмотр исходного кода

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 20 лет назад
Родитель
Сommit
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;
 	}