Revert "ID:335 - Check return value of fseek(), prevent segfault"

This reverts commit 6d8ad594ccd582ac0a004e55c8459409376fc264 because of wrong
e-mail address in commit.
This commit is contained in:
Zdenek Styblik 2016-06-09 12:01:29 +02:00
parent 6d8ad594cc
commit 4ecac48c68

View File

@ -1399,12 +1399,7 @@ HpmfwupgGetBufferFromFile(char *imageFilename,
return HPMFWUPG_ERROR; return HPMFWUPG_ERROR;
} }
/* Get the raw data in file */ /* Get the raw data in file */
ret = fseek(pImageFile, 0, SEEK_END); fseek(pImageFile, 0, SEEK_END);
if (ret != 0) {
lprintf(LOG_ERR, "Failed to seek in the image file '%s'",
imageFilename);
return HPMFWUPG_ERROR;
}
pFwupgCtx->imageSize = ftell(pImageFile); pFwupgCtx->imageSize = ftell(pImageFile);
pFwupgCtx->pImageData = malloc(sizeof(unsigned char)*pFwupgCtx->imageSize); pFwupgCtx->pImageData = malloc(sizeof(unsigned char)*pFwupgCtx->imageSize);
if (pFwupgCtx->pImageData == NULL) { if (pFwupgCtx->pImageData == NULL) {