Skip to content

Kqueue: Fix undefined behaviour when GetStringUTFChars fails and SO_ACCEPTFILTER is supported#16441

Merged
chrisvest merged 1 commit into
4.2from
fix_undef_behaviour_bsd
Mar 12, 2026
Merged

Kqueue: Fix undefined behaviour when GetStringUTFChars fails and SO_ACCEPTFILTER is supported#16441
chrisvest merged 1 commit into
4.2from
fix_undef_behaviour_bsd

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

We did miss some NULL checks which could cause undefined behaviour which most likely would cause a crash. As this only happens when SO_ACCEPTFILTER is supported and when GetStringUTFChars fails it was not possible to reach this on MacOS.

Modifications:

Add missing NULL checks

Result:

No more undef behaviour

…CCEPTFILTER is supported

Motivation:

We did miss some NULL checks which could cause undefined behaviour which most likely would cause a crash. As this only happens when SO_ACCEPTFILTER is supported and when GetStringUTFChars fails it was not possible to reach this on MacOS.

Modifications:

Add missing NULL checks

Result:

No more undef behaviour
@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 requested a review from chrisvest March 12, 2026 19:09
@chrisvest chrisvest merged commit 38eee8d into 4.2 Mar 12, 2026
39 of 40 checks passed
@chrisvest chrisvest deleted the fix_undef_behaviour_bsd branch March 12, 2026 19:44
netty-project-bot pushed a commit that referenced this pull request Mar 12, 2026
…CCEPTFILTER is supported (#16441)

Motivation:

We did miss some NULL checks which could cause undefined behaviour which
most likely would cause a crash. As this only happens when
SO_ACCEPTFILTER is supported and when GetStringUTFChars fails it was not
possible to reach this on MacOS.

Modifications:

Add missing NULL checks

Result:

No more undef behaviour

(cherry picked from commit 38eee8d)
@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port PR for 4.1: #16448

@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 12, 2026
netty-project-bot pushed a commit that referenced this pull request Mar 12, 2026
…CCEPTFILTER is supported (#16441)

Motivation:

We did miss some NULL checks which could cause undefined behaviour which
most likely would cause a crash. As this only happens when
SO_ACCEPTFILTER is supported and when GetStringUTFChars fails it was not
possible to reach this on MacOS.

Modifications:

Add missing NULL checks

Result:

No more undef behaviour

(cherry picked from commit 38eee8d)
@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #16449

@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 12, 2026
normanmaurer added a commit that referenced this pull request Mar 13, 2026
… fails and SO_ACCEPTFILTER is supported (#16448)

Auto-port of #16441 to 4.1
Cherry-picked commit: 38eee8d

---
Motivation:

We did miss some NULL checks which could cause undefined behaviour which
most likely would cause a crash. As this only happens when
SO_ACCEPTFILTER is supported and when GetStringUTFChars fails it was not
possible to reach this on MacOS.

Modifications:

Add missing NULL checks

Result:

No more undef behaviour

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
normanmaurer added a commit that referenced this pull request Mar 13, 2026
… fails and SO_ACCEPTFILTER is supported (#16449)

Auto-port of #16441 to 5.0
Cherry-picked commit: 38eee8d

---
Motivation:

We did miss some NULL checks which could cause undefined behaviour which
most likely would cause a crash. As this only happens when
SO_ACCEPTFILTER is supported and when GetStringUTFChars fails it was not
possible to reach this on MacOS.

Modifications:

Add missing NULL checks

Result:

No more undef behaviour

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