]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw : add check empty for sync url 41766/head
authorcao.leilc <cao.leilc@inspur.com>
Fri, 2 Apr 2021 03:55:54 +0000 (11:55 +0800)
committerCory Snyder <csnyder@iland.com>
Tue, 8 Jun 2021 18:12:00 +0000 (14:12 -0400)
Fixes: https://tracker.ceph.com/issues/50103
Signed-off-by: caolei <halei15848934852@163.com>
(cherry picked from commit 3a4e0b79310b21eeee37043d5419887bb41c0cf6)

src/rgw/rgw_rest_client.cc

index 6a28999feaceff7ff8998eae24c62bbae7f3103f..0ae6aed6f5683701091b130ac76f7720fca32bb0 100644 (file)
@@ -714,7 +714,7 @@ int RGWRESTStreamRWRequest::do_send_prepare(RGWAccessKey *key, map<string, strin
                                          bufferlist *send_data)
 {
   string new_url = url;
-  if (new_url[new_url.size() - 1] != '/')
+  if (!new_url.empty() && new_url.back() != '/')
     new_url.append("/");
   
   RGWEnv new_env;