summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2016-07-31 09:53:48 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2016-07-31 09:53:48 (GMT)
commit0d9fc8dc45de49a050b1d13f03ff9f4713f736fb (patch)
treeec0d9f4df239b8ad1c483ae699da39d8fbfe8ecf
parent1c8d2ecc67997ee88dfabbeafdbc2e9805a10e3f (diff)
downloadDoxygen-0d9fc8dc45de49a050b1d13f03ff9f4713f736fb.zip
Doxygen-0d9fc8dc45de49a050b1d13f03ff9f4713f736fb.tar.gz
Doxygen-0d9fc8dc45de49a050b1d13f03ff9f4713f736fb.tar.bz2
Bug 768954 - Segmentation fault when processing md containing only header
-rw-r--r--src/markdown.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 9526ce2..d63e149 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -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;
}