[
https://issues.apache.org/jira/browse/LUCENE-5662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Muir updated LUCENE-5662:
--------------------------------
Attachment: LUCENE-5662.patch
Here's a patch, adding/reusing byte[] was fine, because it would wrap it in a
BytesRef, so you'd hit an implicit NPE.
BytesRef was unsafe both in the ctor and the reusing (setBytesRefValue).
String was only safe if you didnt reuse. setStringValue was missing a check.
> Missing Field null checks can result in aborted segments
> --------------------------------------------------------
>
> Key: LUCENE-5662
> URL: https://issues.apache.org/jira/browse/LUCENE-5662
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Fix For: 4.8.1, 4.9, 5.0
>
> Attachments: LUCENE-5662.patch
>
>
> This is bad because you lose other unrelated documents in IndexWriter's
> buffer.
> Simple example:
> {code}
> BytesRef v = null; // somehow my app screwed up
> doc.add(new StoredField("foo", v));
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]