pupnp / pupnp

libupnp: Build UPnP-compliant control points, devices, and bridges on several operating systems.
https://pupnp.github.io/pupnp
BSD 3-Clause "New" or "Revised" License
349 stars 114 forks source link

miniserver: Don't initialize sockets for invalid IPs #398

Closed AlaricSenat closed 1 year ago

AlaricSenat commented 1 year ago

init_socket_stuff was ignoring inet_pton's return value causing invalid IPs being seen as valid which caused bad calls to bind and listen further in the code path.

Invalid binds were frequents for interfaces providing only one IP protocol version (IPv4 or v6). In those cases, gIF_IPV4 or gIF_IPV4 were left to their default values (an empty string) causing inet_pton to fail silently without aborting the socket opening and binding...

Refs #195