Permalink
Browse files

crypto: fix length argument to snprintf()

Introduced in commit d3d6cd3 ("src: improve SSL version extraction
logic".)

PR-URL: #23622
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information...
bnoordhuis authored and Trott committed Oct 12, 2018
1 parent c1288fe commit 9ed4646df05b9593075bb0cd0b3ab420bae482a5
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/node_crypto.cc
View
@@ -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);
}

0 comments on commit 9ed4646

Please sign in to comment.