]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDCap: Check for empty namespace 29146/head
authorBrad Hubbard <bhubbard@redhat.com>
Mon, 22 Jul 2019 00:05:09 +0000 (10:05 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Tue, 20 Aug 2019 01:25:23 +0000 (11:25 +1000)
Fixes: http://tracker.ceph.com/issues/40835
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
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;
     }