From 7b4d05894df0b9151dfcf95c3d70c652dc9b922c Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 19 Mar 2012 19:12:03 +0200 Subject: MAINT-141, MAINT-95, MAINT-62 FIXED Don't delete files using masks starting with "/". Encountering such a mask will show a warning message and throw a debug assertion. --- indra/llvfs/lldir.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/llvfs/lldir.cpp') diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index f3ac17d612..32d081d552 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -86,6 +86,13 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask) std::string fullpath; S32 result; + // File masks starting with "/" will match nothing, so we consider them invalid. + if (LLStringUtil::startsWith(mask, getDirDelimiter())) + { + llwarns << "Invalid file mask: " << mask << llendl; + llassert(!"Invalid file mask"); + } + LLDirIterator iter(dirname, mask); while (iter.next(filename)) { -- cgit v1.2.3