Use reallocarray() in sc_vector

This fails safely in case of overflow.
This commit is contained in:
Romain Vimont
2023-03-03 01:18:17 +01:00
parent f3998c280b
commit e318aa1cb1
+1 -1
View File
@@ -118,7 +118,7 @@ static inline void *
sc_vector_reallocdata_(void *ptr, size_t count, size_t size,
size_t *restrict pcap, size_t *restrict psize)
{
void *p = realloc(ptr, count * size);
void *p = reallocarray(ptr, count, size);
if (!p) {
return NULL;
}