[EU-FOSSA] Fix stack overflow issue while affecting "ext" field on stylers.xml
This commit is contained in:
parent
ccdf7d8d8b
commit
4421161848
@ -326,11 +326,14 @@ bool isInList(const TCHAR *token, const TCHAR *list)
|
|||||||
if ((!token) || (!list))
|
if ((!token) || (!list))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TCHAR word[64];
|
const size_t wordLen = 64;
|
||||||
|
size_t listLen = lstrlen(list);
|
||||||
|
|
||||||
|
TCHAR word[wordLen];
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
size_t j = 0;
|
size_t j = 0;
|
||||||
|
|
||||||
for (size_t len = lstrlen(list); i <= len; ++i)
|
for (; i <= listLen; ++i)
|
||||||
{
|
{
|
||||||
if ((list[i] == ' ')||(list[i] == '\0'))
|
if ((list[i] == ' ')||(list[i] == '\0'))
|
||||||
{
|
{
|
||||||
@ -347,6 +350,9 @@ bool isInList(const TCHAR *token, const TCHAR *list)
|
|||||||
{
|
{
|
||||||
word[j] = list[i];
|
word[j] = list[i];
|
||||||
++j;
|
++j;
|
||||||
|
|
||||||
|
if (j >= wordLen)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user