From f4337a06418ee1bc389550ed876b9d5f6e780695 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 12 Oct 2018 22:22:06 +0200 Subject: [PATCH] crypto: fix length argument to snprintf() Introduced in commit d3d6cd3eca ("src: improve SSL version extraction logic".) --- src/node_crypto.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 96f4cf2ba7076d..627c14360e18fd 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -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); }