Skip to content

Commit 2b015fd

Browse files
claudiamurialdoclaudiamurialdo
andauthored
Code QL issue with logging. (#1233)
* Code QL issue with logging. Updated logging in the FindInstance method of the GeneXus.Metadata namespace to use DebugSanitized instead of Debug * Update file path handling in GXCompressor.cs Refactor directory creation and file extraction logic to use destFileName instead of fullPath and destinationPath. --------- Co-authored-by: claudiamurialdo <[email protected]>
1 parent 74f2008 commit 2b015fd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

dotnet/src/dotnetframework/GxClasses/Helpers/GXMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static public object FindInstance(string defaultAssemblyName, string clss, Objec
226226
static public object FindInstance(string defaultAssemblyName, string nspace, string clss, Object[] constructorArgs, Assembly defaultAssembly, bool ignoreCase=false)
227227
{
228228
Type objType = FindType( defaultAssemblyName, nspace, clss, defaultAssembly, ignoreCase);
229-
GXLogging.Debug(log, "CreateInstance class:", clss);
229+
GXLogging.DebugSanitized(log, "CreateInstance class:", clss);
230230
return Activator.CreateInstance(objType, constructorArgs);
231231
}
232232
static public void ExecuteVoidRef(object o, string mthd, Object[] args)

dotnet/src/dotnetframework/GxCompress/GXCompressor.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -613,21 +613,21 @@ private static void DecompressZip(FileInfo file, string outputPath)
613613

614614
if (string.IsNullOrEmpty(entry.Name))
615615
{
616-
Directory.CreateDirectory(fullPath);
616+
Directory.CreateDirectory(destFileName);
617617
}
618618
else
619619
{
620620
#if NETCORE
621-
string directoryPath = Path.GetDirectoryName(fullPath)!;
621+
string directoryPath = Path.GetDirectoryName(destFileName)!;
622622
#else
623-
string directoryPath = Path.GetDirectoryName(fullPath);
623+
string directoryPath = Path.GetDirectoryName(destFileName);
624624
if (directoryPath != null)
625625
{
626626
Directory.CreateDirectory(directoryPath);
627627
}
628628
#endif
629629

630-
entry.ExtractToFile(fullPath, true);
630+
entry.ExtractToFile(destFileName, true);
631631
}
632632
}
633633
}
@@ -760,18 +760,18 @@ private static void DecompressJar(FileInfo file, string outputPath)
760760

761761
if (string.IsNullOrEmpty(entry.Name))
762762
{
763-
Directory.CreateDirectory(destinationPath);
763+
Directory.CreateDirectory(destFileName);
764764
}
765765
else
766766
{
767767
#if NETCORE
768-
string destinationDir = Path.GetDirectoryName(destinationPath)!;
768+
string destinationDir = Path.GetDirectoryName(destFileName)!;
769769
#else
770-
string destinationDir = Path.GetDirectoryName(destinationPath);
770+
string destinationDir = Path.GetDirectoryName(destFileName);
771771
if (!string.IsNullOrEmpty(destinationDir))
772772
Directory.CreateDirectory(destinationDir);
773773
#endif
774-
entry.ExtractToFile(destinationPath, true);
774+
entry.ExtractToFile(destFileName, true);
775775
}
776776
}
777777
}

0 commit comments

Comments
 (0)