From: Zdenek S. <st...@us...> - 2013-07-25 11:56:57
|
Update of /cvsroot/ipmitool/ipmitool/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9937/lib Modified Files: ipmi_hpmfwupg.c Log Message: ID: 65 - Fixes for configure.in for cross compilation Check return value of fread() in 'lib/ipmi_hpmfwupg.c'. Commit for Dan Gora Index: ipmi_hpmfwupg.c =================================================================== RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_hpmfwupg.c,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** ipmi_hpmfwupg.c 17 Jul 2013 10:45:56 -0000 1.45 --- ipmi_hpmfwupg.c 25 Jul 2013 11:56:54 -0000 1.46 *************** *** 2608,2611 **** --- 2608,2612 ---- { int rc = HPMFWUPG_SUCCESS; + int ret = 0; FILE* pImageFile = fopen(imageFilename, "rb"); *************** *** 2626,2630 **** if ( pFwupgCtx->pImageData != NULL ) { ! fread(pFwupgCtx->pImageData, sizeof(unsigned char), pFwupgCtx->imageSize, pImageFile); } else --- 2627,2637 ---- if ( pFwupgCtx->pImageData != NULL ) { ! 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 |