diff options
| -rw-r--r-- | ext/openssl/openssl.c | 4 |
1 files 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 |
