Check the return value of fseek.

Reported by:	Coverity
CID:		1388267
Sponsored by:	iXsystems, Inc.
This commit is contained in:
benno 2018-04-12 15:50:19 +00:00
parent 19e7651c74
commit 1ebccb19a5

View File

@ -80,7 +80,9 @@ static int
read_sector(FILE *iso, daddr_t sector, char *buffer)
{
fseek(iso, sector * ISO_DEFAULT_BLOCK_SIZE, SEEK_SET);
if (fseek(iso, sector * ISO_DEFAULT_BLOCK_SIZE, SEEK_SET) != 0) {
return (errno);
}
if (fread(buffer, ISO_DEFAULT_BLOCK_SIZE, 1, iso) != 1) {
return (errno);
}