mirror of
https://github.com/javalsai/lidm.git
synced 2025-11-28 12:35:24 +01:00
add: safety bound checks for vec_get
This commit is contained in:
@@ -121,5 +121,8 @@ void* vec_pop(struct Vector* vec) {
|
||||
}
|
||||
|
||||
void* vec_get(struct Vector* vec, uint32_t index) {
|
||||
if (index >= vec->length)
|
||||
return NULL;
|
||||
|
||||
return vec->pages[index];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user