blob: c38efb6533701bc02f665f6c65088b4c29329c23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# HG changeset patch
# User Magnus Melin <mkmelin+mozilla@iki.fi>
# Date 1533928828 -10800
# Node ID 80754eac3809bff2f8fe4ea05bd16dbaf3dfe1a7
# Parent 020481090e4e241e345f92410688c9f81e543911
Bug 1482248 - don't crash on empty file name in nsMsgLocalStoreUtils::nsShouldIgnoreFile. r=jorgk
diff --git a/mailnews/local/src/nsMsgLocalStoreUtils.cpp b/mailnews/local/src/nsMsgLocalStoreUtils.cpp
--- a/mailnews/local/src/nsMsgLocalStoreUtils.cpp
+++ b/mailnews/local/src/nsMsgLocalStoreUtils.cpp
@@ -23,16 +23,19 @@ nsMsgLocalStoreUtils::AddDirectorySepara
path->GetLeafName(leafName);
leafName.AppendLiteral(FOLDER_SUFFIX);
return path->SetLeafName(leafName);
}
bool
nsMsgLocalStoreUtils::nsShouldIgnoreFile(nsAString& name)
{
+ if (name.IsEmpty())
+ return true;
+
char16_t firstChar = name.First();
if (firstChar == '.' || firstChar == '#' ||
name.CharAt(name.Length() - 1) == '~')
return true;
if (name.LowerCaseEqualsLiteral("msgfilterrules.dat") ||
name.LowerCaseEqualsLiteral("rules.dat") ||
name.LowerCaseEqualsLiteral("filterlog.html") ||
|