Skip to content

Commit

Permalink
issue #6917 Crash in php with UTF-8 character
Browse files Browse the repository at this point in the history
Problem is that a value is fed to isspace that is not in the correct range and has to be converted to this range.

compare also Assertion failure generation documentation (fdefe70 of March 30 2016).
  • Loading branch information
albert-github committed Apr 10, 2019
1 parent 16d025c commit a1e030a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util.cpp
Expand Up @@ -1869,7 +1869,7 @@ QCString removeRedundantWhiteSpace(const QCString &s)
case '@': // '@name' -> ' @name'
case '$': // '$name' -> ' $name'
case '\'': // ''name' -> '' name'
if (i>0 && i<l-1 && pc!='=' && pc!=':' && !isspace(pc) &&
if (i>0 && i<l-1 && pc!='=' && pc!=':' && !isspace((uchar)pc) &&
isId(nc) && osp<8) // ")id" -> ") id"
{
*dst++=' ';
Expand Down Expand Up @@ -1913,14 +1913,14 @@ QCString removeRedundantWhiteSpace(const QCString &s)
default:
*dst++=c;
if (c=='t' && csp==5 && i<l-1 && // found 't' in 'const'
!(isId(nc) || nc==')' || nc==',' || isspace(nc))
!(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
) // prevent const ::A from being converted to const::A
{
*dst++=' ';
csp=0;
}
else if (c=='l' && vsp==7 && i<l-1 && // found 'l' in 'virtual'
!(isId(nc) || nc==')' || nc==',' || isspace(nc))
!(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
) // prevent virtual ::A from being converted to virtual::A
{
*dst++=' ';
Expand Down Expand Up @@ -7200,7 +7200,7 @@ bool findAndRemoveWord(QCString &s,const QCString &word)
{
if (i>0 && isspace((uchar)s.at(i-1)))
i--,l++;
else if (i+l<(int)s.length() && isspace(s.at(i+l)))
else if (i+l<(int)s.length() && isspace((uchar)s.at(i+l)))
l++;
s = s.left(i)+s.mid(i+l); // remove word + spacing
return TRUE;
Expand Down

0 comments on commit a1e030a

Please sign in to comment.