summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2012-10-10 13:29:14 -0700
committerYehuda Sadeh <yehuda@inktank.com>2012-10-23 10:43:09 -0700
commit391775b78e5c5e6ab6262a0ac0765160189c246b (patch)
treec1db6aed5e262df60cf15cf7d3b9a8683c8a14de
parentfc05b634721d86386397a7c0e73a438d18236ebc (diff)
downloadceph-391775b78e5c5e6ab6262a0ac0765160189c246b.tar.gz
rgw: handle missing content length in POST
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_rest.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc
index d0bb4e405dc..2b68a79b78a 100644
--- a/src/rgw/rgw_rest.cc
+++ b/src/rgw/rgw_rest.cc
@@ -555,11 +555,12 @@ int RGWPostObj_ObjStore::verify_params()
/* check that we have enough memory to store the object
note that this test isn't exact and may fail unintentionally
for large requests is */
- if (s->length) {
- off_t len = atoll(s->length);
- if (len > (off_t)RGW_MAX_PUT_SIZE) {
- return -ERR_TOO_LARGE;
- }
+ if (!s->length) {
+ return -ERR_LENGTH_REQUIRED;
+ }
+ off_t len = atoll(s->length);
+ if (len > (off_t)RGW_MAX_PUT_SIZE) {
+ return -ERR_TOO_LARGE;
}
return 0;