]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: skip empty http args in method parse() to avoid extra effort 11989/head
authorguozhandong <18896723979@139.com>
Tue, 15 Nov 2016 09:03:14 +0000 (17:03 +0800)
committerguozhandong <18896723979@139.com>
Tue, 15 Nov 2016 09:03:22 +0000 (17:03 +0800)
Signed-off-by: Guo Zhandong <guozhandong@cmss.chinamobile.com>
src/rgw/rgw_common.cc

index 9aa6f3c4d7d9264c4407aa8408f5b9c22b9efb92..36ddf9b5ca4611e254c075126102fd75436d8db2 100644 (file)
@@ -733,7 +733,12 @@ int RGWHTTPArgs::parse()
 {
   int pos = 0;
   bool end = false;
-  if (str[pos] == '?') pos++;
+
+  if (str.empty())
+    return 0;
+
+  if (str[pos] == '?')
+    pos++;
 
   while (!end) {
     int fpos = str.find('&', pos);