CVE-2015-5330: Fix handling of unicode near string endings