Check the return value of fseek.

Reported by:	Coverity
CID:		1388267
Sponsored by:	iXsystems, Inc.
This commit is contained in:
Benno Rice 2018-04-12 15:50:19 +00:00
parent 459a61fd2d
commit 695fed77a8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332437

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);
}