LUCENE-5207: Limit the maximum class name length

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5207@1522877 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2013-09-13 11:27:26 +00:00
parent f05d6b11a8
commit d586a56a3b
1 changed files with 3 additions and 0 deletions

View File

@ -196,6 +196,9 @@ public class JavascriptCompiler {
wasIdentifierPart = false;
}
}
// limit maximum length, theoretically 65536 is allowed in constant pool (in UTF-8 format).
if (sb.length() > 1204) sb.setLength(1024);
// remove trailing underscores
for (int i = sb.length() - 1; i >= 0; i--) {
if (sb.charAt(i) == '_') {
sb.setLength(i);