donnerpeter commented on a change in pull request #2238:
URL: https://github.com/apache/lucene-solr/pull/2238#discussion_r563673451



##########
File path: 
lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
##########
@@ -1299,7 +1314,12 @@ void appendFlag(char flag, StringBuilder to) {
         if (replacement.isEmpty()) {
           continue;
         }
-        flags[upto++] = (char) Integer.parseInt(replacement);
+        int flag = Integer.parseInt(replacement);
+        if (flag == 0 || flag >= Character.MAX_VALUE) { // read default flags 
as well
+          throw new IllegalArgumentException(

Review comment:
       `ParseException` needs some `errorOffset` obligatorily (which is 
dubiously filled here with the current line number), and it's not available in 
this method, and not all callers have anything meaningful to pass there. For 
consistency, we could replace `ParseException` with something less choosy :)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to