From 0ad28fdd3761d69a6858bef1905e0a59cb7bf8d9 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 5c049bd8305..bebcbd12c3b 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -333,7 +333,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))); }