From 35eb9fc6ad300fa67845d48bdd0c71e9b350f760 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 3 Aug 2009 14:07:57 +0000 Subject: avoid possible NULL dereference caused by my previous fix --- lib/ssluse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ssluse.c b/lib/ssluse.c index 0b98ba0b6..07824b411 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -1178,7 +1178,7 @@ static CURLcode verifyhost(struct connectdata *conn, else /* not a UTF8 name */ j = ASN1_STRING_to_UTF8(&peer_CN, tmp); - if((int)strlen((char *)peer_CN) != j) { + if(peer_CN && ((int)strlen((char *)peer_CN) != j)) { /* there was a terminating zero before the end of string, this cannot match and we return failure! */ failf(data, "SSL: illegal cert name field"); -- cgit v1.2.3