ID:382 - Fix memcpy() params in HpmFwupgActionUploadFirmware()

The 'bufLength' variable holds a constant chunk size. If the actual
data length is less than the 'bufLength', then it crashes IPMITool. The
code was already there to calculate the remaining data length, but was
not used in memcpy(). We changed it to use the 'count' variable which
holds the proper available data length.

Commit for: Viswanathan Swaminathan
This commit is contained in:
Zdenek Styblik 2015-07-27 06:37:37 +02:00
parent 169d9ac3fc
commit ff80a188f3

View File

@ -1199,7 +1199,7 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
} else { } else {
count = (unsigned short)((pDataTemp+lengthOfBlock) - pData); count = (unsigned short)((pDataTemp+lengthOfBlock) - pData);
} }
memcpy(&uploadCmd.req->data, pData, bufLength); memcpy(&uploadCmd.req->data, pData, count);
imageOffset = 0x00; imageOffset = 0x00;
blockLength = 0x00; blockLength = 0x00;
numTxPkts++; numTxPkts++;