mirror of
https://github.com/javalsai/lidm.git
synced 2025-08-31 02:18:00 +02: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