Permalink
Browse files

Fixed potential string buffer issue for dot graphs

  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Jan 25, 2015
1 parent 025ed8d commit 6b24aba8fce772d9e46e3174a655281eeb44ad84
Showing with 8 additions and 4 deletions.
  1. +8 −4 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;

0 comments on commit 6b24aba

Please sign in to comment.