Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS crash on invalid options specified in .vbproj files #694

Closed
tmat opened this issue Feb 19, 2015 · 3 comments · Fixed by #2687
Closed

VS crash on invalid options specified in .vbproj files #694

tmat opened this issue Feb 19, 2015 · 3 comments · Fixed by #2687

Comments

@tmat
Copy link
Member

tmat commented Feb 19, 2015

Handling invalid content of .vbproj files needs to be hardened.

ConvertedVisualBasicProjectOptions constructor may throw various exceptions, which VisualBasicProject.SetCompilerOptions then converts to FailFast.

@Pilchie Pilchie added the Resolution-Not Reproducible The described behavior could not be reproduced by developers label Feb 24, 2015
@Pilchie
Copy link
Member

Pilchie commented Feb 24, 2015

Can you please give some specific examples?

@Pilchie Pilchie closed this as completed Feb 24, 2015
@tmat tmat reopened this Feb 24, 2015
@tmat
Copy link
Member Author

tmat commented Feb 24, 2015

I see at least 3 explicit Throws in the function:

 Select Case options.vbRuntimeKind
                Case VBRuntimeKind.DefaultRuntime
                    runtimes.Add(Path.Combine(compilerHost.GetSdkPath(), "Microsoft.VisualBasic.dll"))

                Case VBRuntimeKind.SpecifiedRuntime
                    If options.wszSpecifiedVBRuntime Is Nothing Then
                        Throw New ArgumentException()
                    End If

                    ' If they specified a fully qualified file, use it
                    If File.Exists(options.wszSpecifiedVBRuntime) Then
                        runtimes.Add(options.wszSpecifiedVBRuntime)
                    Else
                        ' If it's just a filename, try to find it in the SDK path.
                        If options.wszSpecifiedVBRuntime <> Path.GetFileName(options.wszSpecifiedVBRuntime) Then
                            Throw New ArgumentException()
                        End If

                        Dim runtimePath = Path.Combine(compilerHost.GetSdkPath(), options.wszSpecifiedVBRuntime)
                        If File.Exists(runtimePath) Then
                            runtimes.Add(runtimePath)
                        Else
                            Throw New ArgumentException()
                        End If
                    End If
            End Select

@tmat
Copy link
Member Author

tmat commented Feb 24, 2015

Not counting the fact that Path APIs throw if paths contain invalid characters, etc.

@Pilchie Pilchie removed the Resolution-Not Reproducible The described behavior could not be reproduced by developers label Feb 24, 2015
@Pilchie Pilchie added this to the 1.0 (stable) milestone Feb 24, 2015
@Pilchie Pilchie assigned mattwar and unassigned basoundr May 8, 2015
@mattwar mattwar assigned tmat and unassigned mattwar Jun 4, 2015
@tmat tmat added the Verified label Jun 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants