CommandManager::parse: fix invalid memory read
This commit is contained in:
parent
99eaa259e6
commit
346108ec62
|
@ -147,14 +147,15 @@ TokenList parse(const String& line,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while ((line[pos] != opening_delimiter or line[pos-1] == '\\') and
|
while (pos != length and
|
||||||
pos != length)
|
(line[pos] != opening_delimiter or line[pos-1] == '\\'))
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
while (pos != length and not is_horizontal_blank(line[pos]) and
|
while (pos != length and not is_horizontal_blank(line[pos]) and
|
||||||
(not is_command_separator(line[pos]) or line[pos-1] == '\\'))
|
(not is_command_separator(line[pos]) or
|
||||||
|
(pos != 0 and line[pos-1] == '\\')))
|
||||||
++pos;
|
++pos;
|
||||||
|
|
||||||
if (token_start != pos)
|
if (token_start != pos)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user