ID: 65 - Fixes for configure.in for cross compilation

Check return value of fread() in 'lib/ipmi_hpmfwupg.c'.

Commit for Dan Gora
This commit is contained in:
Zdenek Styblik 2013-07-25 11:56:54 +00:00
parent 2e5fbc878b
commit 2d71d428f3

View File

@ -2607,6 +2607,7 @@ static int HpmfwupgActivationStage(struct ipmi_intf *intf, struct HpmfwupgUpgrad
int HpmfwupgGetBufferFromFile(char* imageFilename, struct HpmfwupgUpgradeCtx* pFwupgCtx)
{
int rc = HPMFWUPG_SUCCESS;
int ret = 0;
FILE* pImageFile = fopen(imageFilename, "rb");
if ( pImageFile == NULL )
@ -2625,7 +2626,13 @@ int HpmfwupgGetBufferFromFile(char* imageFilename, struct HpmfwupgUpgradeCtx* pF
rewind(pImageFile);
if ( pFwupgCtx->pImageData != NULL )
{
fread(pFwupgCtx->pImageData, sizeof(unsigned char), pFwupgCtx->imageSize, pImageFile);
ret = fread(pFwupgCtx->pImageData, sizeof(unsigned char),
pFwupgCtx->imageSize, pImageFile);
if (ret != pFwupgCtx->imageSize) {
lprintf(LOG_ERROR,"Failed to read file %s size %d",
imageFilename, pFwupgCtx->imageSize);
rc = HPMFWUPG_ERROR;
}
}
else
{