diff options
Diffstat (limited to 'dpi/https.c')
-rw-r--r-- | dpi/https.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dpi/https.c b/dpi/https.c index e9bf7b5f..d6a16405 100644 --- a/dpi/https.c +++ b/dpi/https.c @@ -452,10 +452,11 @@ static int handle_certificate_problem(SSL * ssl_connection) case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: /*Either self signed and untrusted*/ /*Extract CN from certificate name information*/ - cn = strstr(remote_cert->name, "/CN=") + 4; - if (cn == NULL) + if ((cn = strstr(remote_cert->name, "/CN=")) == NULL) break; + cn += 4; + if ((cn_end = strstr(cn, "/")) == NULL ) cn_end = cn + strlen(cn); |