From 9ef962f9ee82f1d0610795f8ed28d82f2f6d04fc Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 16 Sep 2011 19:16:30 +0200 Subject: [PATCH] crypto: fix error message buffer overrun ERR_error_string() expects a buffer of at least 256 bytes, the input buffer was not even half that size. Use ERR_error_string_n() instead. --- src/node_crypto.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index a908f526bd..a7c48da3b2 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -316,7 +316,7 @@ Handle SecureContext::SetCert(const Arguments& args) { String::New("SSL_CTX_use_certificate_chain"))); } char string[120]; - ERR_error_string(err, string); + ERR_error_string_n(err, string, sizeof string); return ThrowException(Exception::Error(String::New(string))); }