Skip to content

Commit

Permalink
Fix uninitailized read reported by msan
Browse files Browse the repository at this point in the history
  • Loading branch information
dutow committed Mar 8, 2018
1 parent 809c7ac commit 094f260
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ int toku_loader_cleanup_temp_files(DB_ENV *env) {

result = 0;
while ((de = readdir(d))) {
int r = memcmp(de->d_name, loader_temp_prefix, strlen(loader_temp_prefix));
int r = strncmp(de->d_name, loader_temp_prefix, strlen(loader_temp_prefix));
if (r == 0 && strlen(de->d_name) == strlen(loader_temp_prefix) + strlen(loader_temp_suffix)) {
int fnamelen = strlen(dir) + 1 + strlen(de->d_name) + 1; // One for the slash and one for the trailing NUL.
char fname[fnamelen];
Expand Down

0 comments on commit 094f260

Please sign in to comment.