svn commit: r332437 - head/usr.bin/etdump
Benno Rice
benno at FreeBSD.org
Thu Apr 12 15:50:20 UTC 2018
Author: benno
Date: Thu Apr 12 15:50:19 2018
New Revision: 332437
URL: https://svnweb.freebsd.org/changeset/base/332437
Log:
Check the return value of fseek.
Reported by: Coverity
CID: 1388267
Sponsored by: iXsystems, Inc.
Modified:
head/usr.bin/etdump/etdump.c
Modified: head/usr.bin/etdump/etdump.c
==============================================================================
--- head/usr.bin/etdump/etdump.c Thu Apr 12 15:47:47 2018 (r332436)
+++ head/usr.bin/etdump/etdump.c Thu Apr 12 15:50:19 2018 (r332437)
@@ -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);
}
More information about the svn-src-all
mailing list