-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix BytesReferenceStreamInput#skip with offset #25634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There is a bug when a call to `BytesReferenceStreamInput` skip is made on a `BytesReference` that has an initial offset. The offset for the current slice is added to the current index and then subtracted from the length. This introduces the possibility of a negative number of bytes to skip. This happens inside a loop, which leads to an infinte loop. This commit correctly subtracts the current slice index from the slice.length. Additionally, the `BytesArrayTests` are modified to test instances that include an offset.
s1monw
approved these changes
Jul 11, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch LGTM this should also go into 5.5.1 and above?
Tim-Brooks
added a commit
that referenced
this pull request
Jul 11, 2017
There is a bug when a call to `BytesReferenceStreamInput` skip is made on a `BytesReference` that has an initial offset. The offset for the current slice is added to the current index and then subtracted from the length. This introduces the possibility of a negative number of bytes to skip. This happens inside a loop, which leads to an infinte loop. This commit correctly subtracts the current slice index from the slice.length. Additionally, the `BytesArrayTests` are modified to test instances that include an offset.
Tim-Brooks
added a commit
that referenced
this pull request
Jul 11, 2017
There is a bug when a call to `BytesReferenceStreamInput` skip is made on a `BytesReference` that has an initial offset. The offset for the current slice is added to the current index and then subtracted from the length. This introduces the possibility of a negative number of bytes to skip. This happens inside a loop, which leads to an infinte loop. This commit correctly subtracts the current slice index from the slice.length. Additionally, the `BytesArrayTests` are modified to test instances that include an offset.
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Jul 12, 2017
* master: Add an underscore to flood stage setting Avoid failing install if system-sysctl is masked Add another parent value option to join documentation (elastic#25609) Ensure we rewrite common queries to `match_none` if possible (elastic#25650) Remove reference to field-stats docs. Optimize the order of bytes in uuids for better compression. (elastic#24615) Fix BytesReferenceStreamInput#skip with offset (elastic#25634) Limit the number of concurrent shard requests per search request (elastic#25632)
jasontedor
added a commit
to fred84/elasticsearch
that referenced
this pull request
Jul 12, 2017
* master: (181 commits) Use a non default port range in MockTransportService Add a shard filter search phase to pre-filter shards based on query rewriting (elastic#25658) Prevent excessive disk consumption by log files Migrate RestHttpResponseHeadersIT to ESRestTestCase (elastic#25675) Use config directory to find jvm.options Fix inadvertent rename of systemd tests Adding basic search request documentation for high level client (elastic#25651) Disallow lang to be used with Stored Scripts (elastic#25610) Fix typo in ScriptDocValues deprecation warnings (elastic#25672) Changes DocValueFieldsFetchSubPhase to reuse doc values iterators for multiple hits (elastic#25644) Query range fields by doc values when they are expected to be more efficient than points. Remove SearchHit#internalHits (elastic#25653) [DOCS] Reorganized the highlighting topic so it's less confusing. Add an underscore to flood stage setting Avoid failing install if system-sysctl is masked Add another parent value option to join documentation (elastic#25609) Ensure we rewrite common queries to `match_none` if possible (elastic#25650) Remove reference to field-stats docs. Optimize the order of bytes in uuids for better compression. (elastic#24615) Fix BytesReferenceStreamInput#skip with offset (elastic#25634) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a bug when a call to
BytesReferenceStreamInput
skip is madeon a
BytesReference
that has an initial offset. The offset for thecurrent slice is added to the current index and then subtracted from the
length. This introduces the possibility of a negative number of bytes to
skip. This happens inside a loop, which leads to an infinte loop.
This commit correctly subtracts the current slice index from the
slice.length. Additionally, the
BytesArrayTests
are modified to testinstances that include an offset.