mirror of
https://github.com/moparisthebest/curl
synced 2024-11-12 04:25:08 -05:00
avoid possible NULL dereference caused by my previous fix
This commit is contained in:
parent
df09088a96
commit
35eb9fc6ad
@ -1178,7 +1178,7 @@ static CURLcode verifyhost(struct connectdata *conn,
|
|||||||
else /* not a UTF8 name */
|
else /* not a UTF8 name */
|
||||||
j = ASN1_STRING_to_UTF8(&peer_CN, tmp);
|
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
|
/* there was a terminating zero before the end of string, this
|
||||||
cannot match and we return failure! */
|
cannot match and we return failure! */
|
||||||
failf(data, "SSL: illegal cert name field");
|
failf(data, "SSL: illegal cert name field");
|
||||||
|
Loading…
Reference in New Issue
Block a user