Skip to content

Commit 6e240e8

Browse files
committed
Fix segfault parsing varargs with -doxygen
Closes swig#1643
1 parent aa59c81 commit 6e240e8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

CHANGES.current

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
77
Version 4.0.2 (in progress)
88
===========================
99

10+
2020-01-16: mcfarljm
11+
#1643 #1654 When using -doxygen, fix segfault when nameless parameters or vararg parameters
12+
are used.
13+
1014
2020-01-16: mcfarljm
1115
#1632 #1659 Fix newline handling for doxygen "///" comments.
1216

Source/Doxygen/pydoc.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,12 @@ std::string PyDocConverter::getParamValue(std::string param) {
449449
ParmList *plist = CopyParmList(Getattr(currentNode, "parms"));
450450
for (Parm *p = plist; p; p = nextSibling(p)) {
451451
String *pname = Getattr(p, "name");
452-
if (Char(pname) != param)
453-
continue;
454-
455-
String *pval = Getattr(p, "value");
456-
if (pval) value = Char(pval);
457-
break;
452+
if (pname && Char(pname) == param) {
453+
String *pval = Getattr(p, "value");
454+
if (pval)
455+
value = Char(pval);
456+
break;
457+
}
458458
}
459459
Delete(plist);
460460
return value;

0 commit comments

Comments
 (0)