Skip to content

Commit a354091

Browse files
bnoordhuisMylesBorins
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 b3e43a6 commit a354091

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_crypto.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5756,7 +5756,7 @@ std::string GetOpenSSLVersion() {
57565756
const int start = search(OPENSSL_VERSION_TEXT, 0, ' ') + 1;
57575757
const int end = search(OPENSSL_VERSION_TEXT + start, start, ' ') + 1;
57585758
const int len = end - start;
5759-
snprintf(buf, len, "%.*s\n", len, &OPENSSL_VERSION_TEXT[start]);
5759+
snprintf(buf, sizeof(buf), "%.*s\n", len, &OPENSSL_VERSION_TEXT[start]);
57605760
return std::string(buf);
57615761
}
57625762

0 commit comments

Comments
 (0)