Skip to content

Commit 36684d8

Browse files
jkartsevatuanpach
andauthored
Update src/Disks/ObjectStorages/MetadataStorageFromPlainRewritableObjectStorage.cpp
Co-authored-by: Tuan Pham Anh <[email protected]>
1 parent a79cf5d commit 36684d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Disks/ObjectStorages/MetadataStorageFromPlainRewritableObjectStorage.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ void MetadataStorageFromPlainRewritableObjectStorage::load(bool is_initial_load)
178178
}
179179

180180
/// Check that the file is a direct child.
181-
if (remote_file_path.substr(full_prefix_length) == filename)
181+
chassert(full_prefix_length < remote_file_path.size());
182+
if (std::string_view(remote_file_path.data() + full_prefix_length) == filename)
182183
files.insert(std::move(filename));
183184
}
184185

0 commit comments

Comments
 (0)