From: yuliyang Date: Sun, 8 Apr 2018 08:00:31 +0000 (-0400) Subject: rgw: return EINVAL if max_keys can not convert correctly X-Git-Tag: v12.2.6~121^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ab004e63bb26ac74da21e771fbc7ab11fdfc7b54;p=ceph.git rgw: return EINVAL if max_keys can not convert correctly fix: http://tracker.ceph.com/issues/23586 Signed-off-by: yuliyang (cherry picked from commit 6c46f2a0d3fe46c7615d3b9b0c07377c280d42df) --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index f20cbd9b862bc..85ba68abd9356 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2274,6 +2274,7 @@ int RGWListBucket::parse_max_keys() char *endptr; max = strtol(max_keys.c_str(), &endptr, 10); if (endptr) { + if (endptr == max_keys.c_str()) return -EINVAL; while (*endptr && isspace(*endptr)) // ignore white space endptr++; if (*endptr) {