Skip to content

Commit

Permalink
Bug 768954 - Segmentation fault when processing md containing only he…
Browse files Browse the repository at this point in the history
…ader
  • Loading branch information
Dimitri van Heesch committed Jul 31, 2016
1 parent 1c8d2ec commit 0d9fc8d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/markdown.cpp
Expand Up @@ -2206,17 +2206,20 @@ static bool isExplicitPage(const QCString &docs)
{
int i=0;
const char *data = docs.data();
int size=docs.size();
while (i<size && (data[i]==' ' || data[i]=='\n'))
{
i++;
}
if (i<size+1 &&
(data[i]=='\\' || data[i]=='@') &&
(qstrncmp(&data[i+1],"page ",5)==0 || qstrncmp(&data[i+1],"mainpage",8)==0)
)
if (data)
{
return TRUE;
int size=docs.size();
while (i<size && (data[i]==' ' || data[i]=='\n'))
{
i++;
}
if (i<size+1 &&
(data[i]=='\\' || data[i]=='@') &&
(qstrncmp(&data[i+1],"page ",5)==0 || qstrncmp(&data[i+1],"mainpage",8)==0)
)
{
return TRUE;
}
}
return FALSE;
}
Expand Down

0 comments on commit 0d9fc8d

Please sign in to comment.