1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 01:06:04 +00:00

Remove NUL characters from file names

This commit is contained in:
M66B 2020-10-29 11:50:06 +01:00
parent 70b868cc41
commit 43d7dc2c8e

View file

@ -1012,7 +1012,10 @@ public class Helper {
if (name == null)
return null;
return name.replaceAll("[?:\"*|/\\\\<>]", "_");
return name
// Canonical files names cannot contain NUL
.replace("\0", "")
.replaceAll("[?:\"*|/\\\\<>]", "_");
}
static String getExtension(String filename) {