You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/04/25 17:40:12 UTC

[GitHub] [lucene] risdenk opened a new pull request, #836: LUCENE-10533: SpellChecker.formGrams is missing bounds check

risdenk opened a new pull request, #836:
URL: https://github.com/apache/lucene/pull/836

   # Description
   
   SpellChecker.formGrams is missing a bounds check that results in NegativeArraySizeException in some cases.
   
   # Solution
   
   This adds a bounds check to SpellChecker.formGrams and ensures that SpellChecker has a proper upper bound on the size of the word being matched against. Also adds tests to check for this case.
   
   # Tests
   
   `./gradlew check`
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [ ] I have reviewed the guidelines for [How to Contribute](https://github.com/apache/lucene/blob/main/CONTRIBUTING.md) and my code conforms to the standards described there to the best of my ability.
   - [ ] I have created a Jira issue and added the issue ID to my pull request title.
   - [ ] I have given Lucene maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [ ] I have developed this patch against the `main` branch.
   - [ ] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

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


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


[GitHub] [lucene] risdenk merged pull request #836: LUCENE-10533: SpellChecker.formGrams is missing bounds check

Posted by GitBox <gi...@apache.org>.
risdenk merged PR #836:
URL: https://github.com/apache/lucene/pull/836


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

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


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


[GitHub] [lucene] rmuir commented on pull request #836: LUCENE-10533: SpellChecker.formGrams is missing bounds check

Posted by GitBox <gi...@apache.org>.
rmuir commented on PR #836:
URL: https://github.com/apache/lucene/pull/836#issuecomment-1108899794

   Should we really return no-results if a user asks to spellcheck the empty string? Or maybe just a better, more obvious exception?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

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


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


[GitHub] [lucene] rmuir commented on pull request #836: LUCENE-10533: SpellChecker.formGrams is missing bounds check

Posted by GitBox <gi...@apache.org>.
rmuir commented on PR #836:
URL: https://github.com/apache/lucene/pull/836#issuecomment-1108916100

   OK i looked into some surrounding behavior in suggest module:
   
   Looks like returning empty list is what DirectSpellChecker does:
   
   https://github.com/apache/lucene/blob/main/lucene/suggest/src/java/org/apache/lucene/search/spell/DirectSpellChecker.java#L317-L320
   
   And it seems to be behavior of suggesters too?
   
   https://github.com/apache/lucene/blob/main/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestFSTCompletion.java#L208-L211
   
   So given the choice, I think let's go with consistency and return empty list. sorry for the noise...


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

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


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


[GitHub] [lucene] risdenk commented on pull request #836: LUCENE-10533: SpellChecker.formGrams is missing bounds check

Posted by GitBox <gi...@apache.org>.
risdenk commented on PR #836:
URL: https://github.com/apache/lucene/pull/836#issuecomment-1108904174

   Yea thats a 100% valid question and one I'm not sure what the right answer is. I tried to find a definition of what is expected here. I'm not tied to this solution, its just the least intrusive since there is no behavior change.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

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


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