From: Pierre Joye Date: Wed, 8 Aug 2007 06:29:46 +0000 (+0000) Subject: - fix regression introduced with #42222 (thx to tony and mattias for the X-Git-Tag: php-5.2.4RC2~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e507b4c4ceaed73937766232b968d006d49f3a5c;p=php - fix regression introduced with #42222 (thx to tony and mattias for the head up) --- 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