Skip to content
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

Potential NPE when warningMessageCallback is null #778

Closed
mrotteveel opened this issue Jan 6, 2024 · 0 comments
Closed

Potential NPE when warningMessageCallback is null #778

mrotteveel opened this issue Jan 6, 2024 · 0 comments
Assignees
Milestone

Comments

@mrotteveel
Copy link
Member

While running Sonarlint on master, it detected a potential NPE if the warningMessageCallback is null in AbstractWireOperations.consumePackets. It hasn't occurred in the wild because the method in question is currently only called in a case where the callback is not null, but this is easy to miss if that method might get called elsewhere due to future changes.

In addition, some code paths allow setting the defaultWarningMessageCallback of AbstractWireOperations to null and this should be disallowed (again those cases currently don't invoke the methods dereferencing warningMessageCallback or defaultWarningMessageCallback).

The fix should be backported to Jaybird 5 (no ticket will be created for Jaybird 6, as it will be committed as part of a larger code cleanup).

@mrotteveel mrotteveel added this to the v5.0.4 milestone Jan 6, 2024
@mrotteveel mrotteveel self-assigned this Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant