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.
pull/22966/head
Ben Noordhuis 2011-09-16 19:16:30 +02:00
parent 2d0b1ed7ad
commit 0ad28fdd37
1 changed files with 1 additions and 1 deletions

View File

@ -333,7 +333,7 @@ Handle<Value> SecureContext::SetCert(const Arguments& args) {
String::New("SSL_CTX_use_certificate_chain"))); String::New("SSL_CTX_use_certificate_chain")));
} }
char string[120]; char string[120];
ERR_error_string(err, string); ERR_error_string_n(err, string, sizeof string);
return ThrowException(Exception::Error(String::New(string))); return ThrowException(Exception::Error(String::New(string)));
} }