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); }