Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
crypto: fix error message buffer overrun
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bnoordhuis committed Sep 22, 2011
1 parent 97d355c commit 9ef962f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Expand Up @@ -316,7 +316,7 @@ Handle<Value> 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)));
}

Expand Down

0 comments on commit 9ef962f

Please sign in to comment.