[ 
https://issues.apache.org/jira/browse/LUCENE-8034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16263518#comment-16263518
 ] 

ASF subversion and git services commented on LUCENE-8034:
---------------------------------------------------------

Commit 726ee05240a65badf6c3499dd1e29daf490a3e48 in lucene-solr's branch 
refs/heads/master from Mike McCandless
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=726ee05 ]

LUCENE-8034: use subtraction instead of addition to sidestep int overflow in 
SpanNotQuery


> SpanNotWeight returns wrong results due to integer overflow
> -----------------------------------------------------------
>
>                 Key: LUCENE-8034
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8034
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/query/scoring, core/search
>            Reporter: Hari Menon
>            Priority: Minor
>              Labels: newbie, patch
>         Attachments: LUCENE-8034.patch
>
>
> In SpanNotQuery, there is an acceptance condition:
> {code:java}
> if (candidate.endPosition() + post <= excludeSpans.startPosition()) {
>     return AcceptStatus.YES;
> }
> {code}
> This overflows in case `candidate.endPosition() + post > Integer.MAX_VALUE`. 
> I have a fix for this which I am working on. Basically I am flipping the add 
> to a subtract.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to