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 <[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]>
1 parent a0468fe commit cb569a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: 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)