From: Suyash Dongre Date: Wed, 11 Sep 2024 12:37:45 +0000 (+0530) Subject: Checking for dereference of a null pointer (loaded from variable 't') X-Git-Tag: v20.0.0~1005^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=04f26b29e0c036ea74e341a71733b06cf571e75e;p=ceph.git Checking for dereference of a null pointer (loaded from variable 't') Fixes: https://tracker.ceph.com/issues/68029 Signed-off-by: Suyash Dongre --- diff --git a/src/rgw/rgw_iam_policy.cc b/src/rgw/rgw_iam_policy.cc index 068a93c4d95..ce76ed4c3c3 100644 --- a/src/rgw/rgw_iam_policy.cc +++ b/src/rgw/rgw_iam_policy.cc @@ -596,6 +596,7 @@ bool ParseState::do_string(CephContext* cct, const char* s, size_t l) { bool is_action = false; bool is_valid_action = false; Statement* t = p.statements.empty() ? nullptr : &(p.statements.back()); + ceph_assert(t || w->id == TokenID::Version || w->id == TokenID::Id); // Top level! if (w->id == TokenID::Version) {