Skip to content

Commit cb569a3

Browse files
bnoordhuisjasnell
authored andcommitted
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>
1 parent a0468fe commit cb569a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_crypto.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -5745,7 +5745,7 @@ std::string GetOpenSSLVersion() {
57455745
const int start = search(OPENSSL_VERSION_TEXT, 0, ' ') + 1;
57465746
const int end = search(OPENSSL_VERSION_TEXT + start, start, ' ') + 1;
57475747
const int len = end - start;
5748-
snprintf(buf, len, "%.*s\n", len, &OPENSSL_VERSION_TEXT[start]);
5748+
snprintf(buf, sizeof(buf), "%.*s\n", len, &OPENSSL_VERSION_TEXT[start]);
57495749
return std::string(buf);
57505750
}
57515751

0 commit comments

Comments
 (0)