Poco StreamSocket segfault

StreamSocket class within Poco 1.4.2p1 library is not thread safe when used under Linux, because gethostbyname() is not thread-safe under Linux. For instance, if a client like

is used to make several connections, a segmentation fault can occur:
Debug session for the DNS.cpp shows that there is no alias addresses:
When threads are switched, null string is stored within HostEntry::HostEntry(struct hostent* entry). This causes the segmentation fault shown above.

FreeBSD does not suffer of this issue.


10 print "mail: contact at alepho.com | skype: karastojko | stackoverflow: karastojko | github: karastojko"
20 print "(c) 2009-2022 www.alepho.com"