berthubert / simplomon

Very simple monitoring system with a single configuration file
MIT License
97 stars 12 forks source link

Fix local4/local6 typo in sendQuery leading to UB #35

Closed wandernauta closed 2 months ago

wandernauta commented 3 months ago

Before this fix, if only a local IPv6 address was given, an attempt would be made to reset the port on the nonexistent local IPv4 address. The intended reset would be missed, so the following (nonsense) config...

https{url="https://example.com", dns={"::1"}, localIP6="[::1]:8282"}

...would first hit UB and then (if that had no effect) consistently send the DNS question from port 8282.

berthubert commented 2 months ago

Thanks!