Skip to content

Commit 9ef962f

Browse files
committed
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.
1 parent 97d355c commit 9ef962f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_crypto.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ Handle<Value> SecureContext::SetCert(const Arguments& args) {
316316
String::New("SSL_CTX_use_certificate_chain")));
317317
}
318318
char string[120];
319-
ERR_error_string(err, string);
319+
ERR_error_string_n(err, string, sizeof string);
320320
return ThrowException(Exception::Error(String::New(string)));
321321
}
322322

0 commit comments

Comments
 (0)