Fixed vulnerability

Unit tests output (e.g. Console.WriteLine in test method) was passed
unchanged to dotnetbuilderwrapper (that was supposed to receive
serialized report only)
dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 11 years ago
parent 85da2c86fc
commit 3e6fa71641
  1. 1
      DotNetBuilder/Compiler.cs
  2. 1
      DotNetBuilder/MicroBuildServer.DotNetBuilder.csproj
  3. 1
      DotNetBuilder/NUnitTester.cs
  4. 4
      DotNetBuilder/Program.cs
  5. 13
      DotNetBuilder/StubWriter.cs

@ -61,7 +61,6 @@ namespace MicroBuildServer.DotNetBuilder
private string GetLine(string format, params object[] args)
{
var result = new string('\t', indent) + string.Format(format, args);
//Console.WriteLine(result);
return result;
}
}

@ -94,6 +94,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Response.cs" />
<Compile Include="NUnitTester.cs" />
<Compile Include="StubWriter.cs" />
<Compile Include="TestRequest.cs" />
</ItemGroup>
<ItemGroup>

@ -143,6 +143,7 @@ namespace MicroBuildServer.DotNetBuilder
public void DoTest()
{
Console.SetOut(new StubWriter());
var listener = new Listener();
CoreExtensions.Host.InitializeService();
var package = new TestPackage(TestLibraryPath);

@ -35,8 +35,10 @@ namespace MicroBuildServer.DotNetBuilder
static void Main(string[] args)
{
var input = Console.In.ReadToEnd();
var outWriter = Console.Out;
Console.SetOut(new StubWriter());
var result = Process(input, args);
Console.Write(JsonConvert.SerializeObject(result, Formatting.Indented));
outWriter.Write(JsonConvert.SerializeObject(result, Formatting.Indented));
}
}
}

@ -0,0 +1,13 @@
using System.IO;
using System.Text;
namespace MicroBuildServer.DotNetBuilder
{
class StubWriter : TextWriter
{
public override Encoding Encoding
{
get { return Encoding.Default; }
}
}
}
Loading…
Cancel
Save