Fix a bounds check in remove_abandoned (#5024)

This commit is contained in:
Nicolas Silva authored and GitHub committed 2024-01-09 11:24:18 -05:00
1 parent 37755b6985
commit 4400a58470
1 file changed
+1 -1
+1 -1
View File
@@ -88,7 +88,7 @@ impl<A: HalApi, Id: TypedId, T: Resource<Id>> ResourceTracker<Id, T>
fn remove_abandoned(&mut self, id: Id) -> bool {
let index = id.unzip().0 as usize;
if index > self.metadata.size() {
if index >= self.metadata.size() {
return false;
}