Skip to content

Native transports: Fix undefined behaviour when GetStringUTFChars fails while open FD#16450

Merged
normanmaurer merged 2 commits into
4.2from
n_undef
Mar 13, 2026
Merged

Native transports: Fix undefined behaviour when GetStringUTFChars fails while open FD#16450
normanmaurer merged 2 commits into
4.2from
n_undef

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

Motivation:

We need to handle the case of GetStringUTFChars returning NULL as otherwise we run into undefined behavior which will most likely cause a crash

Modifications:

Return -ENOMEM in case of failure

Result:

No more undef behavior

…ls while open FD

Motivation:

We need to handle the case of GetStringUTFChars returning NULL as otherwise we run into undefined behavior which will most likely cause a crash

Modifications:

Return -ENOMEM in case of failure

Result:

No more undef behavior
@normanmaurer normanmaurer added this to the 4.2.11.Final milestone Mar 12, 2026
@normanmaurer normanmaurer added needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Mar 12, 2026
@normanmaurer normanmaurer merged commit 8996631 into 4.2 Mar 13, 2026
18 of 20 checks passed
@normanmaurer normanmaurer deleted the n_undef branch March 13, 2026 08:19
netty-project-bot pushed a commit that referenced this pull request Mar 13, 2026
…ls while open FD (#16450)

Motivation:

We need to handle the case of GetStringUTFChars returning NULL as
otherwise we run into undefined behavior which will most likely cause a
crash

Modifications:

Return -ENOMEM in case of failure

Result:

No more undef behavior

(cherry picked from commit 8996631)
@netty-project-bot
Copy link
Copy Markdown
Contributor

Auto-port PR for 4.1: #16456

@github-actions github-actions Bot removed the needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. label Mar 13, 2026
netty-project-bot pushed a commit that referenced this pull request Mar 13, 2026
…ls while open FD (#16450)

Motivation:

We need to handle the case of GetStringUTFChars returning NULL as
otherwise we run into undefined behavior which will most likely cause a
crash

Modifications:

Return -ENOMEM in case of failure

Result:

No more undef behavior

(cherry picked from commit 8996631)
@netty-project-bot
Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #16457

@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Mar 13, 2026
normanmaurer added a commit that referenced this pull request Mar 13, 2026
…ingUTFChars fails while open FD (#16457)

Auto-port of #16450 to 5.0
Cherry-picked commit: 8996631

---
Motivation:

We need to handle the case of GetStringUTFChars returning NULL as
otherwise we run into undefined behavior which will most likely cause a
crash

Modifications:

Return -ENOMEM in case of failure

Result:

No more undef behavior

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
normanmaurer added a commit that referenced this pull request Mar 13, 2026
…ingUTFChars fails while open FD (#16456)

Auto-port of #16450 to 4.1
Cherry-picked commit: 8996631

---
Motivation:

We need to handle the case of GetStringUTFChars returning NULL as
otherwise we run into undefined behavior which will most likely cause a
crash

Modifications:

Return -ENOMEM in case of failure

Result:

No more undef behavior

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants