Boost logo

Boost Users :

From: Nils Frielinghaus (nils.frielinghaus_at_[hidden])
Date: 2021-08-09 11:10:32


Hello Boost users,

I experienced a segmentation fault inside Boost in the following scenario:
o There was an illegal DNS entry
o When resolving that illegal DNS entry on a Yocto-based embedded Linux distribution, ::getaddrinfo() returned with the error code EAI_SYSTEM but errno was set to 0
o The function translate_addrinfo_error(int) in boost/asio/detail/impl/socket_ops.ipp translates this into boost::system::error_code(0, boost::asio::error::get_system_category())
o This is then interpreted as a success by the calling function and the other output parameters of ::getaddrinfo() are accessed which resulted in the segmentation fault

My question would be whether this should be considered a bug in the Boost ASIO library?
One could argue that the system should not return EAI_SYSTEM with errno not being set properly.
But one could also argue that returning EAI_SYSTEM indicates that something went wrong and that the output parameters are not to be accessed.

Nils

------
Nils Frielinghaus



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net