diff options
author | albert-github <albert.tests@gmail.com> | 2019-04-10 13:40:38 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-04-10 13:40:38 (GMT) |
commit | a1e030a9679ae515c090193b74aaa4ce9daa09d7 (patch) | |
tree | ea5f7e0ba1bb05b2fb9e28f544bef83729a25d90 /src/util.cpp | |
parent | 16d025c8a08b485f5d43ade0986d716bd6aa06f8 (diff) | |
download | Doxygen-a1e030a9679ae515c090193b74aaa4ce9daa09d7.zip Doxygen-a1e030a9679ae515c090193b74aaa4ce9daa09d7.tar.gz Doxygen-a1e030a9679ae515c090193b74aaa4ce9daa09d7.tar.bz2 |
issue #6917 Crash in php with UTF-8 character
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 (fdefe70a955c8140f080974319bbf97364d3e610 of March 30 2016).
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util.cpp b/src/util.cpp index f92df68..f63e742 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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++=' '; @@ -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++=' '; @@ -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; |