Skip to content

Commit aab06b7

Browse files
committed
PS-3886: Fix uninitailized read reported by msan
1 parent 809c7ac commit aab06b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/loader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ int toku_loader_cleanup_temp_files(DB_ENV *env) {
489489

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

0 commit comments

Comments
 (0)