Skip to content

Commit 558f66e

Browse files
Fix #13500 fuzzing crash (null-pointer-use) in TemplateSimplifier::useDefaultArgumentValues() (#8096)
1 parent 7a03d5f commit 558f66e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/templatesimplifier.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,8 @@ void TemplateSimplifier::useDefaultArgumentValues(TokenAndName &declaration)
11531153
instantiationArgs[index].push_back(tok1);
11541154
tok1 = tok1->next();
11551155
} while (tok1 && tok1 != endLink);
1156+
if (!tok1)
1157+
syntaxError(end);
11561158
instantiationArgs[index].push_back(tok1);
11571159
} else if (tok1->str() == "<" &&
11581160
(tok1->strAt(1) == ">" || (tok1->previous()->isName() &&
@@ -1162,6 +1164,8 @@ void TemplateSimplifier::useDefaultArgumentValues(TokenAndName &declaration)
11621164
instantiationArgs[index].push_back(tok1);
11631165
tok1 = tok1->next();
11641166
} while (tok1 && tok1 != endLink);
1167+
if (!tok1)
1168+
syntaxError(end);
11651169
instantiationArgs[index].push_back(tok1);
11661170
} else if (tok1->str() == ",") {
11671171
++index;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h>teu<""e<>;template<F=F>teu=d

0 commit comments

Comments
 (0)