File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
src/RazorPagesTestSample/Pages
tests/RazorPagesTestSample.Tests Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
2
2
.DS_Store
3
+ # Local configuration file for developers
4
+ src /Application /src /RazorPagesTestSample /config.json
Original file line number Diff line number Diff line change @@ -92,10 +92,15 @@ public async Task<IActionResult> OnPostAnalyzeMessagesAsync()
92
92
return RedirectToPage ( ) ;
93
93
}
94
94
95
- public static void WriteToDirectory ( ZipArchiveEntry entry , string destDirectory )
96
- {
97
- string destFileName = Path . Combine ( destDirectory , entry . FullName ) ;
98
- entry . ExtractToFile ( destFileName ) ;
95
+ public static void WriteToDirectory ( ZipArchiveEntry entry , string destDirectory )
96
+ {
97
+ string destFileName = Path . GetFullPath ( Path . Combine ( destDirectory , entry . FullName ) ) ;
98
+ string fullDestDirPath = Path . GetFullPath ( destDirectory + Path . DirectorySeparatorChar ) ;
99
+ if ( ! destFileName . StartsWith ( fullDestDirPath ) ) {
100
+ throw new System . InvalidOperationException ( "Entry is outside the target dir: " + destFileName ) ;
99
101
}
102
+ entry . ExtractToFile ( destFileName ) ;
103
+ }
104
+
100
105
}
101
106
}
Original file line number Diff line number Diff line change 13
13
<PackageReference Include =" Microsoft.EntityFrameworkCore.InMemory" Version =" 8.0.3" />
14
14
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.9.0" />
15
15
<PackageReference Include =" Moq" Version =" 4.20.70" />
16
- <PackageReference Include =" Newtonsoft.Json" Version =" 11 .0.2 " />
16
+ <PackageReference Include =" Newtonsoft.Json" Version =" 13 .0.3 " />
17
17
<PackageReference Include =" System.Diagnostics.TraceSource" Version =" 4.3.0" />
18
18
<PackageReference Include =" System.Net.Http" Version =" 4.3.4" />
19
19
<PackageReference Include =" xunit" Version =" 2.7.0" />
You can’t perform that action at this time.
0 commit comments