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

Fix gelf chunk handler #1986

Merged
merged 5 commits into from Mar 29, 2016

Conversation

Projects
None yet
2 participants
@bernd
Member

bernd commented Mar 29, 2016

  • Check for 128 chunk limit
  • Fix parsing of message chunks

I started to move everything to ChannelBuffers to avoid copying data all the time, but that change was a bit too large for the beta.

Refs graylog-labs/gelf-rb#40

bernd added some commits Mar 29, 2016

Do not allow more than 128 GELF chunks per message
Also catch IllegalStateException and return an invalid result to avoid
bubbling up the exception.
Fix parsing of GELF message chunks
A GELF message with 128 chunks has failed before because the parsing of
the chunk header in GELFMessageChunk was broken. (#sliceInteger())

Use a ChannelBuffer to fix and simplify the chunk header parsing.

@bernd bernd added this to the 2.0.0 milestone Mar 29, 2016

@joschi joschi self-assigned this Mar 29, 2016

@@ -144,7 +131,7 @@ private void extractSequenceNumber() {
// lol duplication
private void extractSequenceCount() {
if (this.sequenceCount == -1) {
final int seqCnt = this.sliceInteger(HEADER_PART_SEQCNT_START, HEADER_PART_SEQCNT_LENGTH);
final int seqCnt = payload.getUnsignedByte(HEADER_PART_SEQCNT_START);;

This comment has been minimized.

@joschi

joschi Mar 29, 2016

Contributor

Superfluous semicolon. 😉

@bernd

This comment has been minimized.

Member

bernd commented Mar 29, 2016

Semicolon removed

@joschi

This comment has been minimized.

Contributor

joschi commented Mar 29, 2016

LGTM. 👍

@joschi joschi merged commit ad47def into master Mar 29, 2016

2 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
ci-server-integration Jenkins build graylog2-server-integration-pr 767 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 256 has succeeded
Details

@joschi joschi deleted the fix-gelf-chunk-handler branch Mar 29, 2016

joschi added a commit that referenced this pull request Apr 6, 2016

Merge pull request #1986 from Graylog2/fix-gelf-chunk-handler
Fix handling of invalid GELF messages with more than 128 chunks
(cherry picked from commit ad47def)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment