]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Checking for dereference of a null pointer (loaded from variable 't')
authorSuyash Dongre <suyashd999@gmail.com>
Wed, 11 Sep 2024 12:37:45 +0000 (18:07 +0530)
committerSuyash Dongre <suyashd999@gmail.com>
Wed, 11 Sep 2024 13:48:06 +0000 (19:18 +0530)
Fixes: https://tracker.ceph.com/issues/68029
Signed-off-by: Suyash Dongre <suyashd999@gmail.com>
src/rgw/rgw_iam_policy.cc

index 068a93c4d950bc5aa1b3b3518a1ac913ab90045a..ce76ed4c3c3e80603fb1b64f8c834e22c6563826 100644 (file)
@@ -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) {