Skip to content

Commit

Permalink
fix solution build
Browse files Browse the repository at this point in the history
  • Loading branch information
mregen committed May 2, 2024
1 parent e835086 commit 09b548c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Fuzzing/Encoders/Fuzz.Tools/Encoders.Testcases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ public enum TestCaseEncoders : int

public static string[] TestcaseEncoderSuffixes = new string[] { ".Binary", ".Json", ".Xml" };

public static void Run(string directoryPath)
public static void Run(string workPath)
{
string workPath = Path.TrimEndingDirectorySeparator(directoryPath);

// Create the Testcases for the binary decoder.
string pathSuffix = TestcaseEncoderSuffixes[(int)TestCaseEncoders.Binary];
string pathTarget = workPath + pathSuffix + Path.DirectorySeparatorChar;
Expand Down
8 changes: 8 additions & 0 deletions Fuzzing/Encoders/Fuzz/FuzzableCode.JsonDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ public static void AflfuzzJsonEncoder(string input)
/// </summary>
public static void LibfuzzJsonDecoder(ReadOnlySpan<byte> input)
{
#if NETFRAMEWORK
string json = Encoding.UTF8.GetString(input.ToArray());
#else
string json = Encoding.UTF8.GetString(input);
#endif
_ = FuzzJsonDecoderCore(json);
}

Expand All @@ -85,7 +89,11 @@ public static void LibfuzzJsonDecoder(ReadOnlySpan<byte> input)
public static void LibfuzzJsonEncoder(ReadOnlySpan<byte> input)
{
IEncodeable encodeable = null;
#if NETFRAMEWORK
string json = Encoding.UTF8.GetString(input.ToArray());
#else
string json = Encoding.UTF8.GetString(input);
#endif
try
{
encodeable = FuzzJsonDecoderCore(json);
Expand Down
2 changes: 1 addition & 1 deletion Fuzzing/Encoders/Fuzz/FuzzableCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static MemoryStream PrepareArraySegmentStream(Stream stream)
do
{
buffer = binaryStream.ReadBytes(segmentSize);
bufferCollection.Add(buffer);
bufferCollection.Add(new ArraySegment<byte>(buffer));
} while (buffer.Length == segmentSize);
memoryStream = new ArraySegmentStream(bufferCollection);
}
Expand Down

0 comments on commit 09b548c

Please sign in to comment.