Fixed buffer overrun in template parsing.

This commit is contained in:
Ianos Gnatiuc
2006-07-03 04:05:16 +00:00
parent 501d7c1aa8
commit 9702c54802
3 changed files with 5 additions and 1 deletions

View File

@@ -62,7 +62,8 @@ static bool tokenxchg(std::string &input, std::string::iterator &pos,
for (int i = 0; i < cnt; i++)
{
std::string::iterator beg = tokend;
if (*beg++ != '{') break;
if ((beg == input.end()) || (*beg++ != '{'))
break;
std::string::iterator end;
for (end = beg; end != input.end(); end++)