From e507b4c4ceaed73937766232b968d006d49f3a5c Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 8 Aug 2007 06:29:46 +0000 Subject: [PATCH] - fix regression introduced with #42222 (thx to tony and mattias for the head up) --- ext/openssl/openssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index e6553786c2..00dbd3f641 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1726,7 +1726,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z /* Finally apply defaults from config file */ for(i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) { int len; - char buffer[200]; + char buffer[200 + 1]; /*200 + \0 !*/ v = sk_CONF_VALUE_value(dn_sk, i); type = v->name; @@ -1743,7 +1743,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z len = 200; } memcpy(buffer, type, len); - buffer[len - 1] = '\0'; + buffer[len] = '\0'; type = buffer; /* Skip past any leading X. X: X, etc to allow for multiple -- 2.40.0