From 7302731524c4c374b6c686895bac9567bf8882cc Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Mon, 9 Jun 2014 00:10:03 +0200 Subject: [PATCH] Check for NULL pointer in 'ai_canonname'. --- src/vmime/platforms/posix/posixHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmime/platforms/posix/posixHandler.cpp b/src/vmime/platforms/posix/posixHandler.cpp index f23f09ad..1bbd039a 100644 --- a/src/vmime/platforms/posix/posixHandler.cpp +++ b/src/vmime/platforms/posix/posixHandler.cpp @@ -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);