You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2017/08/31 06:44:00 UTC

[jira] [Comment Edited] (LUCENE-7946) CharTermAttributeImpl.setLength missing bounds check

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

Uwe Schindler edited comment on LUCENE-7946 at 8/31/17 6:43 AM:
----------------------------------------------------------------

In Java 9 we should use the new Objects methods for bounds checking! [http://download.java.net/java/jdk9/docs/api/java/util/Objects.html#checkIndex-int-int-]
Those are better optimized.


was (Author: thetaphi):
In Java 9 we should use the new Objects methods for bounds checking! http://download.java.net/java/jdk9/docs/api/java/util/Objects.html#checkIndex-int-int-
Those are better optimized.

> CharTermAttributeImpl.setLength missing bounds check
> ----------------------------------------------------
>
>                 Key: LUCENE-7946
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7946
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/analysis
>            Reporter: Robert Muir
>         Attachments: LUCENE-7946.patch
>
>
> CharTermAttribute.setLength partially checks for out of bounds values (exceeds term buffer array size) but doesn't check for negative values.
> This can be confusing as then the negative length will only fail or misbehave much later, for example with the first iteration of LUCENE-7940. It fails later only when we call toString() afterwards.



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