g_string_replace() loops 2**32 times when replacing empty string
g_string_replace (string, "foo", "", "bar", 0)
loops until n overflows back to zero. If it's intended to match Python "foo".replace("", "bar")
, it should match the empty string exactly once in each possible position, resulting in barfbarobarobar
.
Edited by Simon McVittie