From c209bc321a5e65101e3640169f6eb5b51b112bd7 Mon Sep 17 00:00:00 2001 From: Pritha Srivastava Date: Mon, 6 Sep 2021 17:29:25 +0530 Subject: [PATCH] rgw/sts: add check for s->auth.identity pointer which can be null for some calls like AssumeRoleWithWebIdentity in rgw_log.cc Signed-off-by: Pritha Srivastava (cherry picked from commit cdb716252e4c2d1e437fb0eb132334d2e5ce277d) --- src/rgw/rgw_log.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index 02d612bbf195..5876b1789bff 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -585,7 +585,11 @@ int rgw_log_op(RGWREST* const rest, struct req_state *s, const string& op_name, entry.op = op_name; - entry.identity_type = s->auth.identity->get_identity_type(); + if (s->auth.identity) { + entry.identity_type = s->auth.identity->get_identity_type(); + } else { + entry.identity_type = TYPE_NONE; + } if (! s->token_claims.empty()) { entry.token_claims = std::move(s->token_claims); -- 2.47.3