You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hari Menon (JIRA)" <ji...@apache.org> on 2017/11/03 20:47:00 UTC

[jira] [Updated] (LUCENE-8034) SpanNotWeight returns wrong results due to integer overflow

     [ https://issues.apache.org/jira/browse/LUCENE-8034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hari Menon updated LUCENE-8034:
-------------------------------
    Description: 
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.

  was:
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 condition to do subtraction instead of add.


> 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
>
> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org