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

Fix allocation size for interface name to include null-byte #440

Closed
wants to merge 1 commit into from

Conversation

kpcyrd
Copy link

@kpcyrd kpcyrd commented May 6, 2024

Related to recent _FORTIFY_SOURCE=3 changes in Arch Linux:

https://gitlab.archlinux.org/archlinux/packaging/packages/sslh/-/issues/2

Copy link
Contributor

@stokito stokito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resolve_listen function makes malloc itself internally.
So instead of the copying we can just assign directly.

@stokito
Copy link
Contributor

stokito commented May 7, 2024

Also the *listen = malloc(len * sizeof(**listen)); is probably better to replace with calloc

@yrutschle yrutschle closed this in 684374f May 11, 2024
@yrutschle
Copy link
Owner

Thanks for the PR, even if I didn't use if :) I collected Sergey's comments.
I don't know how systemd-sslh-generator is called, so cannot test: please report if it causes problems.

@kpcyrd kpcyrd deleted the off-by-one-strcpy branch May 12, 2024 23:15
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