Inconsistent list state in whitelist management.
Here's the relevant part of the code:
The inconsistency arises from how the new collection is added to the list. Let's break it down:
At the beginning, it writes the new collection to the whitelist with (enabled, no_value)
. This sets the collection as enabled but with no 'next' pointer.
If the list is empty (prev.is_zero()), it correctly sets the new collection as the head of the list and returns.
If the list is not empty, it finds the last element (or the last active element).
After finding the last element, it updates that element's 'next' pointer to point to the new collection: self.white_listed_list.write(prev, (true, collection))
.
The inconsistency is that while the last element in the list now points to the new collection, the new collection itself still has its 'next' pointer set to no_value
(which was set in step 1).
Here's a practical example:
When adding a new collection (let's call it 'NewCol') to a non-empty list:
It correctly finds the current last element (let's call it 'LastCol').
It updates LastCol to point to NewCol.
But it doesn't update NewCol to point to null.
This creates a situation like this: Before: Head -> ... -> LastCol -> null
After: Head -> ... -> LastCol -> NewCol -> [unknown]
The [unknown] is the problem. It should be null, but it's not set.
Incomplete list.
Manual review
Update the 'next' pointer of the new collection after inserting it into the list.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.