From: guozhandong <18896723979@139.com> Date: Tue, 15 Nov 2016 09:03:14 +0000 (+0800) Subject: rgw: skip empty http args in method parse() to avoid extra effort X-Git-Tag: v11.1.0~214^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a1212eb124c2daa1aeea6aac0a4e3e75c9cdda6;p=ceph.git rgw: skip empty http args in method parse() to avoid extra effort Signed-off-by: Guo Zhandong --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 9aa6f3c4d7d..36ddf9b5ca4 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -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);