mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-21 19:10:45 +01:00
shared: fix nm_utils_strsplit_set() to increase buffer size exponentially
This commit is contained in:
parent
21cfeff777
commit
de92e88161
1 changed files with 1 additions and 1 deletions
|
|
@ -569,7 +569,7 @@ nm_utils_strsplit_set (const char *str, const char *delimiters)
|
|||
|
||||
/* reallocate the buffer. Note that for now the string
|
||||
* continues to be in ptr0/s0. We fix that at the end. */
|
||||
alloc_size += 2;
|
||||
alloc_size *= 2;
|
||||
ptr = g_malloc ((sizeof (const char *) * (alloc_size + 1)) + str_len);
|
||||
memcpy (ptr, ptr_old, sizeof (const char *) * plen);
|
||||
if (ptr_old != ptr0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue