Use reallocarray() in sc_vector

This fails safely in case of overflow.
This commit is contained in:
Romain Vimont 2023-02-28 21:49:44 +01:00
parent 6dceb32817
commit c735b8c127
1 changed files with 1 additions and 1 deletions

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