]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/osd/OSDCap.cc
import ceph 14.2.5
[ceph.git] / ceph / src / osd / OSDCap.cc
index e3d541a91df010b7a656e5e0e92bf6c4aeae44ff..b6df192c31ea1c7a5acc65c92fa1e6cd1700a39d 100644 (file)
@@ -115,7 +115,7 @@ bool OSDCapPoolNamespace::is_match(const std::string& pn,
     }
   }
   if (nspace) {
-    if ((*nspace)[nspace->length() - 1] == '*' &&
+    if (!nspace->empty() && nspace->back() == '*' &&
        boost::starts_with(ns, nspace->substr(0, nspace->length() - 1))) {
       return true;
     }