mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-23 04:55:04 +00:00
Use reallocarray() in sc_vector
This fails safely in case of overflow.
This commit is contained in:
parent
6bb37abd4b
commit
2e1cdf204a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue