here's a crashing test and a fix

Edit: I changed the branch and instead of only a crashing test, there's also a fix now. :)

The problem seems to occur when the strings pass a certain length. On my system the crash happens when either one of the strings is 2**20 chars long, or both of them are at least 2**11 chars long.