Skip to content

Commit c0d2605

Browse files
committed
resources: fix often-reported crash with MatchFiles on short file names
1 parent 5f32c99 commit c0d2605

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

code/components/citizen-resources-core/src/ResourceMetaDataComponent.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ void ResourceMetaDataComponent::GlobEntries(const std::string& key, const std::f
321321

322322
for (auto& file : mf)
323323
{
324+
if (file.length() < (relRoot.length() + 1))
325+
{
326+
continue;
327+
}
328+
324329
entryCallback(file.substr(relRoot.length() + 1));
325330
}
326331
}

0 commit comments

Comments
 (0)