dotnet/msbuild

Prevent infinite recursion in Solution parser when a project is nested under itself

Open

#1599 aperta il 22 gen 2017

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)C# (1364 fork)batch import
Area: Solution (.sln)help wantedtriaged

Metriche repository

Star
 (5062 star)
Metriche merge PR
 (Merge medio 11g 7h) (125 PR mergiate in 30 g)

Descrizione

We don't check for invalid project nestings in the solution file, so it's possible to create a solution that crashes MSBuild with stack overflow:

https://github.com/Microsoft/msbuild/blob/xplat/src/XMakeBuildEngine/Construction/Solution/ProjectInSolution.cs#L393

An example solution is: https://github.com/dotnet/corefx/blob/f6ab339f446e37505f93ef9f430801fa1dcc05b8/src/System.Collections.Immutable/System.Collections.Immutable.sln#L40-L41

Note that we should check for indirect recursion as well (loops).

Guida contributor