summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-01-18 12:36:24 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-01-18 12:36:24 (GMT)
commita73a6388956714f4a0dbd07259d0aa1ed4ddaf03 (patch)
tree0364134c643787ce2b939aa94d53a4da74c9ba21
parenteb365849aa3c539e5ed13bc4b3f1e76a4f4421d6 (diff)
downloadDoxygen-a73a6388956714f4a0dbd07259d0aa1ed4ddaf03.zip
Doxygen-a73a6388956714f4a0dbd07259d0aa1ed4ddaf03.tar.gz
Doxygen-a73a6388956714f4a0dbd07259d0aa1ed4ddaf03.tar.bz2
Crash of doxygen on not understood code
When feeding doxygen with: ``` %!test <*33536> %! [a, b, c] = strread ("1,,2", "%s%s%s", "delimiter", ","); ``` in a `.m` files doxygen crashes. The code is seen as Objective-C code but in fact is Octave (Matlab) code and as such not supported / not understood by doxygen. This should not be fed into doxygen, but also should not crash doxygen.
-rw-r--r--src/doxygen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index e32f8da..3c0afe5 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -2612,11 +2612,13 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
type=name;
static const QRegExp reName("[a-z_A-Z][a-z_A-Z0-9]*");
int l=0;
+ int j=0;
int i=args.isEmpty() ? -1 : reName.match(args,0,&l);
if (i!=-1)
{
name=args.mid(i,l);
- args=args.mid(i+l,args.find(')',i+l)-i-l);
+ j=args.find(')',i+l)-i-l;
+ if (j >= 0) args=args.mid(i+l,j);
}
//printf("new: type='%s' name='%s' args='%s'\n",
// type.data(),name.data(),args.data());