Check for NULL pointer in 'ai_canonname'.

This commit is contained in:
Vincent Richard 2014-06-09 00:10:03 +02:00
parent c8c5aa065f
commit 7302731524

View File

@ -210,7 +210,7 @@ const vmime::string posixHandler::getHostName() const
{
for (struct addrinfo* p = info ; p != NULL ; p = p->ai_next)
{
if (isFQDN(p->ai_canonname))
if (p->ai_canonname && isFQDN(p->ai_canonname))
{
const string ret(p->ai_canonname);
freeaddrinfo(info);