Skip to content

Commit

Permalink
refactor security vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcongdon committed Dec 16, 2024
1 parent f3106cf commit 328ea9b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion vHC/HC_Reporting/Functions/Collection/DB/CDbWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ public CDbWorker()



public DataTable ExecQuery(string query)
public DataTable ExecQuery(string query, Dictionary<string, object> parameters)
{
log.Info("executing sql query: " + query);
try
{
using var connection = new SqlConnection(_cString); ;
using SqlCommand command = new SqlCommand(query, connection);
foreach (var param in parameters)
{
command.Parameters.AddWithValue(param.Key, param.Value);
}

connection.Open();
DataTable t = new();

Expand Down
3 changes: 2 additions & 1 deletion vHC/HC_Reporting/Functions/Collection/DB/CQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private void GetSqlServerVersion()
{
log.Info("getting sql server version");
string query = "Select @@version";

//CDbWorker d = new();
DataTable dt = Fetch(query);

Expand Down Expand Up @@ -175,7 +176,7 @@ private DataTable Fetch(string query)
{
log.Info("fetching sql data..");
//CDbWorker d = new();
DataTable dt = dbWorker.ExecQuery(query);
DataTable dt = dbWorker.ExecQuery(query, new System.Collections.Generic.Dictionary<string, object>());

log.Info("fetching sql data..ok!");
return dt;
Expand Down
4 changes: 2 additions & 2 deletions vHC/HC_Reporting/VeeamHealthCheck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<Company>Veeam</Company>
<Authors>AdamC</Authors>
<ApplicationIcon>Health_Check_Icon.ico</ApplicationIcon>
<AssemblyVersion>2.0.0.567</AssemblyVersion>
<AssemblyVersion>2.0.0.568</AssemblyVersion>
<SignAssembly>False</SignAssembly>
<DelaySign>false</DelaySign>
<FileVersion>2.0.0.567</FileVersion>
<FileVersion>2.0.0.568</FileVersion>
<DebugType>full</DebugType>
<SelfContained>true</SelfContained>
<!--These 2 lines are what produce the single file utility. Possibly doesn't work...-->
Expand Down
4 changes: 2 additions & 2 deletions vHC/VhcXTests/VhcXTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<AssemblyVersion>1.0.0.294</AssemblyVersion>
<FileVersion>1.0.0.294</FileVersion>
<AssemblyVersion>1.0.0.295</AssemblyVersion>
<FileVersion>1.0.0.295</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 328ea9b

Please sign in to comment.