From 622ae69ba7b4dd2fe9d4407f0c458f4ae8b2c7b3 Mon Sep 17 00:00:00 2001 From: Kit Chan Date: Wed, 23 Aug 2023 15:32:24 -0700 Subject: [PATCH] Fix CID 1508992, 1508976, 1508972: uninitialized scalar variables --- plugins/lua/ts_lua_crypto.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/lua/ts_lua_crypto.cc b/plugins/lua/ts_lua_crypto.cc index 5e66c0136e8..34ee04c71ff 100644 --- a/plugins/lua/ts_lua_crypto.cc +++ b/plugins/lua/ts_lua_crypto.cc @@ -299,8 +299,8 @@ ts_lua_hmac_md5(lua_State *L) unsigned char *key_bin; unsigned int key_bin_len; - u_char sha_buf[TS_LUA_MD5_DIGEST_LENGTH]; - u_char hex_buf[2 * sizeof(sha_buf)]; + u_char sha_buf[TS_LUA_MD5_DIGEST_LENGTH] = {0}; + u_char hex_buf[2 * sizeof(sha_buf)] = {0}; unsigned int output_length; if (lua_gettop(L) != 2) { @@ -354,8 +354,8 @@ ts_lua_hmac_sha1(lua_State *L) unsigned char *key_bin; unsigned int key_bin_len; - u_char sha_buf[TS_LUA_SHA1_DIGEST_LENGTH]; - u_char hex_buf[2 * sizeof(sha_buf)]; + u_char sha_buf[TS_LUA_SHA1_DIGEST_LENGTH] = {0}; + u_char hex_buf[2 * sizeof(sha_buf)] = {0}; unsigned int output_length; if (lua_gettop(L) != 2) { @@ -409,8 +409,8 @@ ts_lua_hmac_sha256(lua_State *L) unsigned char *key_bin; unsigned int key_bin_len; - u_char sha_buf[TS_LUA_SHA256_DIGEST_LENGTH]; - u_char hex_buf[2 * sizeof(sha_buf)]; + u_char sha_buf[TS_LUA_SHA256_DIGEST_LENGTH] = {0}; + u_char hex_buf[2 * sizeof(sha_buf)] = {0}; unsigned int output_length; if (lua_gettop(L) != 2) {