Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/FileTypeDetection/Infrastructure/ArchiveInternals.vb
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,6 @@ Namespace Global.Tomtastisch.FileClassifier
Return True
End Function

Private Shared Function TryReadEntryPayloadBounded(entry As SharpCompress.Archives.IArchiveEntry, maxBytes As Long,
ByRef payload As Byte()) As Boolean
Return TryReadEntryPayloadBoundedWithOptions(entry, maxBytes, FileTypeOptions.GetSnapshot(), payload)
End Function

Private Shared Function TryReadEntryPayloadBoundedWithOptions(
entry As SharpCompress.Archives.IArchiveEntry,
maxBytes As Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Namespace Global.Tomtastisch.FileClassifier
''' <returns>Hex-String in Kleinbuchstaben ohne Trennzeichen.</returns>
Public Function EncodeLowerHex(data As Byte()) As String Implements IHexCodec.EncodeLowerHex
Dim safeData = If(data, Array.Empty(Of Byte)())
Dim chars As Char() = Nothing
Dim chars As Char()
Dim index As Integer = 0

If safeData.Length = 0 Then Return String.Empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,20 @@ public void TryProcessNestedGArchive_ReturnsTrue_WithInvalidNestedDescriptor()
}

[Fact]
public void TryReadEntryPayloadBounded_ReturnsFalse_ForInvalidInputs()
public void TryReadEntryPayloadBoundedWithOptions_ReturnsFalse_ForInvalidInputs()
{
var method = typeof(SharpCompressArchiveBackend).GetMethod(
"TryReadEntryPayloadBounded",
"TryReadEntryPayloadBoundedWithOptions",
BindingFlags.NonPublic | BindingFlags.Static,
binder: null,
types: new[] { typeof(IArchiveEntry), typeof(long), typeof(byte[]).MakeByRefType() },
types: new[] { typeof(IArchiveEntry), typeof(long), typeof(FileTypeProjectOptions), typeof(byte[]).MakeByRefType() },
modifiers: null)!;
Assert.NotNull(method);

Assert.False(TestGuard.Unbox<bool>(method.Invoke(null, new object?[] { null, 10L, null })));
var opt = FileTypeProjectOptions.DefaultOptions();
Assert.False(TestGuard.Unbox<bool>(method.Invoke(null, new object?[] { null, 10L, opt, null })));
Assert.False(TestGuard.Unbox<bool>(method.Invoke(null,
new object?[] { CreateZipArchiveEntry("a.txt", new byte[] { 1 }), 0L, null })));
new object?[] { CreateZipArchiveEntry("a.txt", new byte[] { 1 }), 0L, opt, null })));
}

private static IArchiveEntry CreateZipArchiveEntry(string name, byte[] payload)
Expand Down
6 changes: 5 additions & 1 deletion tools/ci/checks/QodanaContractValidator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
{
// Style/noise findings that are not security/reliability regressions for CI gate purposes.
"CheckNamespace",
"RedundantQualifier"
"RedundantQualifier",
"RedundantSuppressNullableWarningExpression",
"UnusedImportClause",
"UnusedMember.Local",
"VBWarnings__BC42309"
};

var argsList = args.ToList();
Expand Down
Loading