diff options
author | asomers <asomers@FreeBSD.org> | 2017-02-28 23:03:51 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2017-02-28 23:03:51 +0000 |
commit | 6f58055068328cf7584c89254aef8552f6000c03 (patch) | |
tree | 35538b516e027a8f2328f5962aefd572c8e33fd1 | |
parent | 8252dd64ac4ea2f1b4cea2b09905f687c834c894 (diff) | |
download | FreeBSD-src-6f58055068328cf7584c89254aef8552f6000c03.zip FreeBSD-src-6f58055068328cf7584c89254aef8552f6000c03.tar.gz |
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
-rw-r--r-- | cddl/usr.sbin/zfsd/case_file.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc index 86c74b1..0cd6596 100644 --- a/cddl/usr.sbin/zfsd/case_file.cc +++ b/cddl/usr.sbin/zfsd/case_file.cc @@ -656,8 +656,11 @@ CaseFile::DeSerializeFile(const char *fileName) 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) { /* |