Skip to content

Correctly handle the case when BUFFER_OVERFLOW happens during unwrap … - #6113

Closed
normanmaurer wants to merge 1 commit into
4.1from
unwrap_overflow
Closed

normanmaurer wants to merge 1 commit into
4.1from
unwrap_overflow

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

…but the readable bytes are bigger then the expected applicationBufferSize

Motivation:

We need to ensure we handle the case when BUFFER_OVERFLOW happens during unwrap but the readable bytes are bigger then the expected applicationBufferSize. Otherwise we may produce an IllegalArgumentException as we will try to allocate a buffer with capacity < 0.

Modifications:

  • Guard against this case.
  • Ensure we not double release buffer on exception when doing unwrap.

Result:

No more exception when running testsuite with java 9.

…but the readable bytes are bigger then the expected applicationBufferSize

Motivation:

We need to ensure we handle the case when BUFFER_OVERFLOW happens during unwrap but the readable bytes are bigger then the expected applicationBufferSize. Otherwise we may produce an IllegalArgumentException as we will try to allocate a buffer with capacity < 0.

Modifications:

- Guard against this case.
- Ensure we not double release buffer on exception when doing unwrap.

Result:

No more exception when running testsuite with java 9.
@normanmaurer normanmaurer self-assigned this Dec 7, 2016
@normanmaurer normanmaurer added this to the 4.0.43.Final milestone Dec 7, 2016
@johnou

johnou commented Dec 7, 2016

Copy link
Copy Markdown
Contributor

@normanmaurer works with JRE8 and fails with JRE9?

@normanmaurer

normanmaurer commented Dec 7, 2016 via email

Copy link
Copy Markdown
Member Author

@johnou

johnou commented Dec 7, 2016

Copy link
Copy Markdown
Contributor

Nice catch!

@normanmaurer

Copy link
Copy Markdown
Member Author

@Scottmitch PTAL .... once this is in we will get successful builds with java9 on our CI servers 👍

@normanmaurer

Copy link
Copy Markdown
Member Author

Cherry-picked into 4.1 (2055f4c) and 4.0 (b1d6b30)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants