summaryrefslogtreecommitdiffstats
path: root/src/htmlgen.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2015-01-02 08:56:45 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2015-01-02 09:45:18 (GMT)
commit312bef563a5be72f6423377247db1b80044bf711 (patch)
tree3a656445fa67469b2f1783932fe127e9f39af69a /src/htmlgen.cpp
parented39dab59f8af2c5b42cfac0b3140cf594412121 (diff)
downloadDoxygen-312bef563a5be72f6423377247db1b80044bf711.zip
Doxygen-312bef563a5be72f6423377247db1b80044bf711.tar.gz
Doxygen-312bef563a5be72f6423377247db1b80044bf711.tar.bz2
Fixed a couple of cases where sharing string data could lead to corruption
Also made dangerous string access more visible by introducing rawData(). This replaces data() which will now return a constant string.
Diffstat (limited to 'src/htmlgen.cpp')
-rw-r--r--src/htmlgen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index 3bb6792..582da45 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -125,7 +125,7 @@ QCString clearBlock(const char *s,const char *begin,const char *end)
QCString result(resLen+1);
char *r;
- for (r=result.data(), p=s; (q=strstr(p,begin))!=0; p=q+endLen)
+ for (r=result.rawData(), p=s; (q=strstr(p,begin))!=0; p=q+endLen)
{
int l = (int)(q-p);
memcpy(r,p,l);
@@ -186,7 +186,7 @@ static QCString getSearchBox(bool serverSide, QCString relPath, bool highlightSe
static QCString removeEmptyLines(const QCString &s)
{
BufStr out(s.length()+1);
- char *p=s.data();
+ const char *p=s.data();
if (p)
{
char c;
@@ -194,7 +194,7 @@ static QCString removeEmptyLines(const QCString &s)
{
if (c=='\n')
{
- char *e = p;
+ const char *e = p;
while (*e==' ' || *e=='\t') e++;
if (*e=='\n')
{