From 5bc962bf3d15ee918eb032e5cb674839aab0224e Mon Sep 17 00:00:00 2001 From: Sreekant Somasekharan Date: Fri, 11 Mar 2022 20:57:36 -0500 Subject: [PATCH] make string variable 'tpath' an empty string. string variable not being empty can lead to incorrect compilation and corrupted output. Change-Id: Ie66756c28aef7417759c29387500970a8b53e44c [ROCm/amdsmi commit: dbe3403bd39d77abfddc88f24650c0ca95d4ada3] --- projects/amdsmi/src/rocm_smi_main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/amdsmi/src/rocm_smi_main.cc b/projects/amdsmi/src/rocm_smi_main.cc index 18bf121e1f..2d51333c91 100755 --- a/projects/amdsmi/src/rocm_smi_main.cc +++ b/projects/amdsmi/src/rocm_smi_main.cc @@ -181,7 +181,7 @@ static bool bdfid_from_path(const std::string in_name, uint64_t *bdfid) { static uint32_t ConstructBDFID(std::string path, uint64_t *bdfid) { assert(bdfid != nullptr); - char tpath[256]; + char tpath[256] = {'\0'}; ssize_t ret; memset(tpath,0,256);