Closed
Description
source: ./quickassist/lookaside/access_layer/src/sample_code/functional/dc/stateless_multi_op_checksum_sample/cpa_dc_stateless_multi_op_checksum_sample.c - function compPerformOp:
lines: 262..266
if (CPA_STATUS_SUCCESS == status)
{
status = OS_MALLOC(&bufferListDstArray[bufferNum].pBuffers,
sizeof(CpaFlatBuffer));
}
lines: 296..311:
if (CPA_STATUS_SUCCESS == status)
{
status = PHYS_CONTIG_ALLOC(
&bufferListDstArray[bufferNum].pBuffers->pData, bufferSize);
bufferListDstArray[bufferNum].pBuffers->dataLenInBytes = bufferSize;
}
if (CPA_STATUS_SUCCESS == status)
{
status = PHYS_CONTIG_ALLOC(
&bufferListDstArray2[bufferNum].pBuffers->pData, bufferSize);
bufferListDstArray2[bufferNum].pBuffers->dataLenInBytes =
bufferSize;
}
memcpy(bufferListSrcArray[bufferNum].pBuffers->pData,
sampleData + (bufferNum * bufferSize),
bufferSize);
bufferListSrcArray[bufferNum].pBuffers may be null if the call to OS_MALLOC fails, so the deference via &bufferListDstArray[bufferNum].pBuffers->pData in the PHYS_CONTIG_ALLOC() call will cause a segmentation fault.
The memcpy call accesses bufferListSrcArray[bufferNum].pBuffers->pData that may be null if the call to PHYS_CONTIG_ALLOC fails, also causing a segmentation fault.
Metadata
Metadata
Assignees
Labels
No labels