From: Matt Benjamin Date: Thu, 27 Oct 2016 22:34:01 +0000 (-0400) Subject: rgw_rest_s3: apply missed base64 try-catch X-Git-Tag: v10.2.6~30^2~8^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=09dc90e263f5780cbca9e7c65ed76269eec1a99a;p=ceph.git rgw_rest_s3: apply missed base64 try-catch Fixes a case missed in 0a4c91e, in Jewel backport only. Fixes: http://tracker.ceph.com/issues/17663 (cherry picked from commit 87ed19e4019e17ea95b27d9c8854027969b445a3) Resolves: rhbz#1381694 Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index da93a9551d21..00b7fd46cd8c 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -3953,7 +3953,13 @@ int RGW_Auth_S3::authorize_v2(RGWRados *store, struct req_state *s) << store->ctx()->_conf->rgw_ldap_uri << dendl; - RGWToken token{from_base64(auth_id)}; + RGWToken token; + /* boost filters and/or string_ref may throw on invalid input */ + try { + token = rgw::from_base64(auth_id); + } catch(...) { + token = std::string(""); + } if (! token.valid()) external_auth_result = -EACCES;