Skip to content

Potential Crash with bad %PATH% #1211

@mjbvz

Description

@mjbvz
Expected Behavior

No crash

Actual Behavior

Crash, all NTVS versions

Steps to Reproduce
  1. Edit the %PATH% environment variable to contain an invalid entry, such as a control character.
  2. Invoke NTVS code in such a way that GetPathToNodeExecutableFromEnvironment reaches the section where it checks the users PATH. Using vstest.console.exe is one way to do this.
  3. Crash in the section:
foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) {
    var execPath = Path.Combine(dir, executable);
    if (File.Exists(execPath)) 
       return execPath;
}

on the line with Path.Combine

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions