mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +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:
parent
169d9ac3fc
commit
ff80a188f3
@ -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++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user