Skip to content

lib/ynl: reject strings with 0 len in ynl_attr_validate() #2

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

Merged
merged 1 commit into from
May 7, 2025

Conversation

spikeh
Copy link
Contributor

@spikeh spikeh commented May 1, 2025

Strings from kernel are always null terminated which is checked for but it currently assumes that the len is > 0. Check that this is true before trying to access the char at (len - 1).

Strings from kernel are always null terminated which is checked for but
it currently assumes that the len is > 0. Check that this is true before
trying to access the char at (len - 1).

Signed-off-by: David Wei <[email protected]>
@kuba-moo
Copy link
Contributor

kuba-moo commented May 7, 2025

Thank you David!

@kuba-moo kuba-moo merged commit d9923a1 into linux-netdev:main May 7, 2025
1 check passed
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.

2 participants