Skip to content

Commit a73a638

Browse files
committed
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.
1 parent eb36584 commit a73a638

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/doxygen.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2612,11 +2612,13 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
26122612
type=name;
26132613
static const QRegExp reName("[a-z_A-Z][a-z_A-Z0-9]*");
26142614
int l=0;
2615+
int j=0;
26152616
int i=args.isEmpty() ? -1 : reName.match(args,0,&l);
26162617
if (i!=-1)
26172618
{
26182619
name=args.mid(i,l);
2619-
args=args.mid(i+l,args.find(')',i+l)-i-l);
2620+
j=args.find(')',i+l)-i-l;
2621+
if (j >= 0) args=args.mid(i+l,j);
26202622
}
26212623
//printf("new: type='%s' name='%s' args='%s'\n",
26222624
// type.data(),name.data(),args.data());

0 commit comments

Comments
 (0)