NagiosEnterprises / nrpe

NRPE Agent
GNU General Public License v2.0
257 stars 133 forks source link

Use sockaddr_storage instead of sockaddr #259

Closed mleiner closed 2 years ago

mleiner commented 2 years ago

This fixes the call of getpeername() and prevents an out-of-bound read.

This is done by providing a bigger buffer to getpeername()'s results.

It's a response to bug #168 and a new implementation of pull request 172.

Code compiles cleanly without warnings.

sawolf commented 2 years ago

Thanks for the patch! I don't have a great way to test IPv6 at the moment, but the change looks fairly straightforward.