Skip to content

Commit

Permalink
Fixed benchmark upload exploit
Browse files Browse the repository at this point in the history
- fixed a way to set different amount of threads before uploading result to server
  • Loading branch information
Prevter committed Oct 20, 2022
1 parent 1cecbd4 commit 9009b99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion FloatTool/ViewModels/BenchmarkViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public sealed class BenchmarkResult
private bool showOnlyCurrent = false;
private int multithreadedSpeed = 0;
private int threadCount = Environment.ProcessorCount;
public int ThreadCountTested = 0;
private int singlethreadedSpeed = 0;
private bool isUpdatingEnabled;

Expand Down Expand Up @@ -225,7 +226,7 @@ public async void PushBenchmarkResults()
using var client = new HttpClient();
var version = Assembly.GetExecutingAssembly().GetName().Version;
client.DefaultRequestHeaders.Add("User-Agent", $"FloatTool/{AppHelpers.VersionCode}");
string paramedURL = $"/submit?cpu={CurrentCpuName}&threads={ThreadCount}&multicore={MultithreadedSpeed}&singlecore={SinglethreadedSpeed}";
string paramedURL = $"/submit?cpu={CurrentCpuName}&threads={ThreadCountTested}&multicore={MultithreadedSpeed}&singlecore={SinglethreadedSpeed}";
HttpResponseMessage response = await client.GetAsync(Utils.API_URL + paramedURL);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Expand Down
1 change: 1 addition & 0 deletions FloatTool/Views/BenchmarkWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ private void StartBenchmark_Click(object sender, RoutedEventArgs e)
Context.MultithreadedSpeed = 0;
Context.SinglethreadedSpeed = 0;
Context.ProgressPercentage = 0;
Context.ThreadCountTested = Context.ThreadCount;

string searchFilter = "0.250000000";

Expand Down

0 comments on commit 9009b99

Please sign in to comment.