Skip to content

Commit

Permalink
make string variable 'tpath' an empty string.
Browse files Browse the repository at this point in the history
string variable not being empty can lead to incorrect compilation
and corrupted output.

Change-Id: Ie66756c28aef7417759c29387500970a8b53e44c
  • Loading branch information
sreekantsomasekharan authored and kentrussell committed Mar 21, 2022
1 parent b17b3b2 commit bd95425
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rocm_smi_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

ret = readlink(path.c_str(), tpath, 256);
Expand Down

0 comments on commit bd95425

Please sign in to comment.