summaryrefslogtreecommitdiffstats
path: root/src/dot.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2015-01-25 12:03:40 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2015-01-25 12:03:40 (GMT)
commit6b24aba8fce772d9e46e3174a655281eeb44ad84 (patch)
tree5bbace436bed07ed9b188e37d58bcfe8d4e888c9 /src/dot.cpp
parent025ed8dd7b58d0fa46b793ed7f3f853e82cda22e (diff)
downloadDoxygen-6b24aba8fce772d9e46e3174a655281eeb44ad84.zip
Doxygen-6b24aba8fce772d9e46e3174a655281eeb44ad84.tar.gz
Doxygen-6b24aba8fce772d9e46e3174a655281eeb44ad84.tar.bz2
Fixed potential string buffer issue for dot graphs
Diffstat (limited to 'src/dot.cpp')
-rw-r--r--src/dot.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dot.cpp b/src/dot.cpp
index f6dc576..1182e8d 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -382,11 +382,14 @@ static bool convertMapFile(FTextStream &t,const char *mapName,
{
QCString buf(maxLineLen);
int numBytes = f.readLine(buf.rawData(),maxLineLen);
- buf[numBytes-1]='\0';
-
- if (buf.left(5)=="<area")
+ if (numBytes>0)
{
- t << replaceRef(buf,relPath,urlOnly,context);
+ buf.resize(numBytes+1);
+
+ if (buf.left(5)=="<area")
+ {
+ t << replaceRef(buf,relPath,urlOnly,context);
+ }
}
}
return TRUE;
@@ -995,6 +998,7 @@ bool DotFilePatcher::run()
{
break;
}
+ line.resize(numBytes+1);
//printf("line=[%s]\n",line.stripWhiteSpace().data());
int i;