add: safety bound checks for vec_get

This commit is contained in:
2024-11-01 13:11:01 +01:00
parent d7bfa79284
commit 49e3ad528f

View File

@@ -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];
}