yrutschle / sslh

Applicative Protocol Multiplexer (e.g. share SSH and HTTPS on the same port)
https://www.rutschle.net/tech/sslh/README.html
GNU General Public License v2.0
4.58k stars 366 forks source link

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

Closed kpcyrd closed 6 months ago

kpcyrd commented 6 months ago

Related to recent _FORTIFY_SOURCE=3 changes in Arch Linux:

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

stokito commented 6 months ago

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

yrutschle commented 6 months ago

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.