From 1d29cc7c7627683ba0ae2aa064abab4ea942b4e8 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Wed, 11 May 2011 17:27:10 -0700 Subject: [PATCH] rgw: in S3 PUT, don't crash on Content-Length == 0 Signed-off-by: Colin McCabe --- src/rgw/rgw_rest.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index d8131e5bd4a54..833d6b9674a9f 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -257,7 +257,9 @@ int RGWCopyObj_REST::get_params() int RGWPutACLs_REST::get_params() { - size_t cl = atoll(s->length); + size_t cl = 0; + if (s->length) + cl = atoll(s->length); if (cl) { data = (char *)malloc(cl + 1); if (!data) { -- 2.39.5