We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af28380 commit 4377485Copy full SHA for 4377485
src/CLR/Core/TypeSystem.cpp
@@ -4586,13 +4586,20 @@ bool CLR_RT_Assembly::FindGenericParamAtTypeSpec(
4586
4587
CLR_RT_SignatureParser::Element element;
4588
4589
- // first Advance() steps into the VAR signature…
+ // get into the GENERICINST
4590
if (FAILED(parser.Advance(element)))
4591
{
4592
return false;
4593
}
4594
4595
- // walk to the Nth parameter
+ // sanity check for invalid parameter position
4596
+ if (genericParameterPosition > parser.GenParamCount)
4597
+ {
4598
+ // not enough parameters!!
4599
+ return false;
4600
+ }
4601
+
4602
+ // walk to the requested parameter position
4603
for (uint32_t i = 0; i <= genericParameterPosition; i++)
4604
4605
0 commit comments