Commit 75ed8035 authored by Subodh Iyengar's avatar Subodh Iyengar Committed by Facebook Github Bot 9

Make error size more explicit

Summary:
We shouldn't rely on the internal buffer size of openssl
for errors.

This makes it more explicit.

Reviewed By: knekritz

Differential Revision: D3285918

fbshipit-source-id: 452bf16a3de151d0aa79c774f2fdfc1e08ee6f9c
parent bc9992bf
...@@ -39,8 +39,8 @@ std::string decodeOpenSSLError( ...@@ -39,8 +39,8 @@ std::string decodeOpenSSLError(
return "SSL connection closed normally"; return "SSL connection closed normally";
} else { } else {
std::array<char, 256> buf; std::array<char, 256> buf;
std::string msg(ERR_error_string(errError, buf.data())); ERR_error_string_n(errError, buf.data(), buf.size());
return msg; return std::string(buf.data(), buf.size());
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment