Skip to content

Commit

Permalink
crypto: fix length argument to snprintf()
Browse files Browse the repository at this point in the history
Introduced in commit d3d6cd3 ("src: improve SSL version extraction
logic".)

PR-URL: #23622
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
  • Loading branch information
bnoordhuis authored and jasnell committed Oct 17, 2018
1 parent a0468fe commit cb569a3
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit cb569a3

Please sign in to comment.