This is an automated email from the ASF dual-hosted git repository.

kichan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 5545f4e139 Fix CID 1508992, 1508976, 1508972: uninitialized scalar 
variables (#10275)
5545f4e139 is described below

commit 5545f4e139a9802afb6839e94e944565a70ec172
Author: Kit Chan <kic...@apache.org>
AuthorDate: Fri Aug 25 13:13:04 2023 -0700

    Fix CID 1508992, 1508976, 1508972: uninitialized scalar variables (#10275)
---
 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 5e66c0136e..34ee04c71f 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) {

Reply via email to