Skip to content

Commit 9e87bdd

Browse files
committed
[BUGFIX] Fixed validation of the forwarder name
1 parent e2bfabf commit 9e87bdd

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

parser/Util.cpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,14 @@ bool pe_util::hasNonPrintable(const char *inp, size_t maxInp)
8080

8181
bool _isFuncChar(const char c)
8282
{
83-
if ((c >= 'a' && c <= 'z')
84-
|| (c >= 'A' && c <= 'Z')
85-
|| (c >= '0' && c <= '9')
86-
|| (c == '_')
87-
|| (c == '.')
88-
|| (c== '#')
89-
|| (c == '@')
90-
|| (c == '?')
91-
|| (c == '-')
92-
|| (c == '\\')
93-
|| (c == '/')
94-
|| (c == ':')
95-
)
96-
{
83+
char charset[] = "_.#@?-\\/:$ ";
84+
85+
if (::isalnum(c)) {
9786
return true;
9887
}
88+
for (size_t i = 0; i < sizeof(charset); ++i) {
89+
if (c == charset[i]) return true;
90+
}
9991
return false;
10092
}
10193

0 commit comments

Comments
 (0)