]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add handling of memory allocation failure in AWS4 auth.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 11 Mar 2016 16:33:47 +0000 (17:33 +0100)
committerJavier M. Mellid <jmunhoz@igalia.com>
Fri, 29 Jul 2016 11:15:47 +0000 (13:15 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
(cherry picked from commit ddbb0ab9d5046672795ec876221de9ebd466364f)

src/rgw/rgw_rest_s3.cc

index 27ae9e696ab5793254221966dafe12ea14f795ba..250b8879f76ed0c3a2669ed3770ec39ae64898a3 100644 (file)
@@ -3227,7 +3227,11 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s)
 
   string algorithm = "AWS4-HMAC-SHA256";
 
-  s->aws4_auth = new rgw_aws4_auth;
+  try {
+    s->aws4_auth = new rgw_aws4_auth;
+  } catch (std::bad_alloc&) {
+    return -ENOMEM;
+  }
 
   if ((!s->http_auth) || !(*s->http_auth)) {