Bugzilla #42067: Fixed a possible StringIndexOutOfBoundsException. Submitted by: Paul Vinkenoog <paul.at.vinkenoog.nl>