NagiosEnterprises / nrpe

NRPE Agent
GNU General Public License v2.0
263 stars 134 forks source link

Use sockaddr_storage in connect_to_remote() #172

Closed ghost closed 6 years ago

ghost commented 7 years ago

Partially fixes #168 by using a sockaddr_storage structure instead of sockaddr in connect_to_remote() , if available. It will prevent an out-of-bounds read when calling inet_ntop.

The bug will still be present when compiling without sockaddr_storage support, but there is not a lot we can do to prevent it without having to declare this structure ourselves and use it across the whole project.

I'm not working often in C, so comments / remarks are highly welcome :-)

box293 commented 6 years ago

Did you mean to close this? It won't appear as a pull request if it is closed and might get missed.

hedenface commented 6 years ago

@nashe Please re-open this so I can merge it.

Will you also add yourself to the THANKS file?