[Bug 301038] String::endsWith() off-by-one error