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);
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to