mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-02 18:53:45 +00:00
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:
@ -1199,7 +1199,7 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
|
||||
} else {
|
||||
count = (unsigned short)((pDataTemp+lengthOfBlock) - pData);
|
||||
}
|
||||
memcpy(&uploadCmd.req->data, pData, bufLength);
|
||||
memcpy(&uploadCmd.req->data, pData, count);
|
||||
imageOffset = 0x00;
|
||||
blockLength = 0x00;
|
||||
numTxPkts++;
|
||||
|
Reference in New Issue
Block a user