]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: avoid string::front() on empty path 33008/head
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 10 Jan 2020 14:41:53 +0000 (09:41 -0500)
committerNathan Cutler <ncutler@suse.com>
Fri, 31 Jan 2020 10:02:06 +0000 (11:02 +0100)
Fixes: https://tracker.ceph.com/issues/43548
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 2136b9873cdfe3440eed19423b9675c6a8b93f03)

src/rgw/rgw_file.h

index 84b17069e20f4829f919115547a57ca03f276cca..0bf488a579b46ec3ab3fcf8b1ee91c2a587bfdc7 100644 (file)
@@ -510,7 +510,8 @@ namespace rgw {
        if (pos > 1) {
          path += "/";
        } else {
-         if (!omit_bucket && (path.front() != '/')) // pretty-print
+         if (!omit_bucket &&
+             ((path.length() == 0) || (path.front() != '/')))
            path += "/";
        }
        path += *s;