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

defect 745
in saCkptSectionCreate if initialData == NULL return INVALID_PARAM


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

Steven Dake 20 лет назад
Родитель
Сommit
950c62c4db
2 измененных файлов с 11 добавлено и 0 удалено
  1. 7 0
      exec/ckpt.c
  2. 4 0
      lib/ckpt.c

+ 7 - 0
exec/ckpt.c

@@ -2105,6 +2105,13 @@ static int message_handler_req_exec_ckpt_sectioncreate (void *message, struct in
 		goto error_exit;
 	}
 
+	if (ckptCheckpoint->checkpointCreationAttributes.maxSectionSize < 
+		req_lib_ckpt_sectioncreate->initialDataSize) {
+
+		error = SA_AIS_ERR_INVALID_PARAM;
+		goto error_exit;
+	}
+
 	/*
 	 * Determine if user-specified checkpoint ID already exists
 	 */

+ 4 - 0
lib/ckpt.c

@@ -961,6 +961,10 @@ saCkptSectionCreate (
 		return (SA_AIS_ERR_INVALID_PARAM);
 	}
 
+	if (initialData == NULL) {
+		return (SA_AIS_ERR_INVALID_PARAM);
+	}
+
 	error = saHandleInstanceGet (&checkpointHandleDatabase, checkpointHandle,
 		(void *)&ckptCheckpointInstance);
 	if (error != SA_AIS_OK) {