From e6cdcd15ae9a2f7087a2724deb105a736e88e3c9 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 9 Jun 2024 12:50:59 +0100 Subject: [PATCH] ext/openssl: Use zend_strnlen for ASN1 time string check --- ext/openssl/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 0744cdab3f90d..7aa9e37ff9762 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -755,7 +755,7 @@ static time_t php_openssl_asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */ timestr_len = (size_t)ASN1_STRING_length(timestr); - if (timestr_len != strlen((const char *)ASN1_STRING_get0_data(timestr))) { + if (timestr_len != zend_strnlen((const char *)ASN1_STRING_get0_data(timestr), timestr_len)) { php_error_docref(NULL, E_WARNING, "Illegal length in timestamp"); return (time_t)-1; }