Author: asomers
Date: Tue Feb 28 23:03:51 2017
New Revision: 314431
URL: https://svnweb.freebsd.org/changeset/base/314431

Log:
  MFC r312396:
  
  Fix an unchecked return value in zfsd
  
  It's pretty unlikely to actually hit this, but good to check it anyway
  
  Reported by:  Coverity
  CID:          1362018
  MFC after:    4 weeks
  Sponsored by: Spectra Logic Corp

Modified:
  stable/11/cddl/usr.sbin/zfsd/case_file.cc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/usr.sbin/zfsd/case_file.cc
==============================================================================
--- stable/11/cddl/usr.sbin/zfsd/case_file.cc   Tue Feb 28 22:58:19 2017        
(r314430)
+++ stable/11/cddl/usr.sbin/zfsd/case_file.cc   Tue Feb 28 23:03:51 2017        
(r314431)
@@ -656,8 +656,11 @@ CaseFile::DeSerializeFile(const char *fi
                uint64_t vdevGUID;
                nvlist_t *vdevConf;
 
-               sscanf(fileName, "pool_%" PRIu64 "_vdev_%" PRIu64 ".case",
-                      &poolGUID, &vdevGUID);
+               if (sscanf(fileName, "pool_%" PRIu64 "_vdev_%" PRIu64 ".case",
+                      &poolGUID, &vdevGUID) != 2) {
+                       throw ZfsdException("CaseFile::DeSerialize: "
+                           "Unintelligible CaseFile filename %s.\n", fileName);
+               }
                existingCaseFile = Find(Guid(poolGUID), Guid(vdevGUID));
                if (existingCaseFile != NULL) {
                        /*
_______________________________________________
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