Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
crypto: fix length argument to snprintf()
Introduced in commit d3d6cd3 ("src: improve SSL version extraction
logic".)
  • Loading branch information
bnoordhuis committed Oct 12, 2018
commit f4337a06418ee1bc389550ed876b9d5f6e780695
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5745,7 +5745,7 @@ std::string GetOpenSSLVersion() {
const int start = search(OPENSSL_VERSION_TEXT, 0, ' ') + 1;
const int end = search(OPENSSL_VERSION_TEXT + start, start, ' ') + 1;
const int len = end - start;
snprintf(buf, len, "%.*s\n", len, &OPENSSL_VERSION_TEXT[start]);
snprintf(buf, sizeof(buf), "%.*s\n", len, &OPENSSL_VERSION_TEXT[start]);
return std::string(buf);
}

Expand Down