defect 681

if null paramter passed to checkpoint service as iovector element, allocate
the io vector element


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@736 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2005-07-13 20:03:15 +00:00
parent 2bdc4e356c
commit 2b0711e51e

View File

@ -1523,6 +1523,15 @@ saCkptCheckpointRead (
/*
* Receive checkpoint section data
*/
if (ioVector[i].dataBuffer == 0) {
ioVector[i].dataBuffer =
malloc (dataLength);
if (ioVector[i].dataBuffer == NULL) {
error = SA_AIS_ERR_NO_MEMORY;
goto error_exit;
}
}
if (dataLength > 0) {
error = saRecvRetry (ckptCheckpointInstance->response_fd, ioVector[i].dataBuffer,
dataLength, MSG_WAITALL | MSG_NOSIGNAL);
@ -1531,9 +1540,6 @@ saCkptCheckpointRead (
}
}
if (res_lib_ckpt_sectionread.header.error != SA_AIS_OK) {
if (erroneousVectorIndex) {
*erroneousVectorIndex = i;
}
goto error_exit;
}
@ -1548,6 +1554,9 @@ error_exit:
saHandleInstancePut (&checkpointHandleDatabase, checkpointHandle);
if (error != SA_AIS_OK && erroneousVectorIndex) {
*erroneousVectorIndex = i;
}
return (error == SA_AIS_OK ? res_lib_ckpt_sectionread.header.error : error);
}