shared: fix nm_utils_strsplit_set() to increase buffer size exponentially

This commit is contained in:
Thomas Haller 2017-11-29 16:26:05 +01:00
parent 21cfeff777
commit de92e88161

View file

@ -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)