Commit 29837b4a authored by David Zeuthen's avatar David Zeuthen

don't overflow when splitting a string

parent b3f4fe27
......@@ -269,8 +269,9 @@ kit_strsplit (const char *s, char delim, size_t *num_tokens)
begin = m;
while (s[m] != delim)
while (s[m] != delim && s[m] != '\0') {
m++;
}
result[n] = kit_strndup (s + begin, m - begin);
if (result[n] == NULL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment