aboutsummaryrefslogtreecommitdiff
path: root/fuzz/Emby.Server.Implementations.Fuzz/Program.cs
diff options
context:
space:
mode:
authorDavid Ullmer <davidullmer@outlook.de>2021-08-10 14:03:21 +0200
committerDavid Ullmer <davidullmer@outlook.de>2021-08-10 14:03:21 +0200
commit45e0f7893ba8f53827983109557447d2c0c8adcf (patch)
tree05ba6fec826a6bcf4cdb17aa1ccfa6939358052c /fuzz/Emby.Server.Implementations.Fuzz/Program.cs
parentb5880c26808a6d7f183acb3f7977b42e13ccbf8a (diff)
parent854bb79ae8b1e7004c731939e54e52ef937abe47 (diff)
Merge remote-tracking branch 'upstream/master' into localization-test
Diffstat (limited to 'fuzz/Emby.Server.Implementations.Fuzz/Program.cs')
-rw-r--r--fuzz/Emby.Server.Implementations.Fuzz/Program.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/fuzz/Emby.Server.Implementations.Fuzz/Program.cs b/fuzz/Emby.Server.Implementations.Fuzz/Program.cs
new file mode 100644
index 000000000..a4a6f5f54
--- /dev/null
+++ b/fuzz/Emby.Server.Implementations.Fuzz/Program.cs
@@ -0,0 +1,32 @@
+using System;
+using Emby.Server.Implementations.Library;
+using SharpFuzz;
+
+namespace Emby.Server.Implementations.Fuzz
+{
+ public static class Program
+ {
+ public static void Main(string[] args)
+ {
+ switch (args[0])
+ {
+ case "PathExtensions.TryReplaceSubPath": Run(PathExtensions_TryReplaceSubPath); return;
+ default: throw new ArgumentException($"Unknown fuzzing function: {args[0]}");
+ }
+ }
+
+ private static void Run(Action<string> action) => Fuzzer.OutOfProcess.Run(action);
+
+ private static void PathExtensions_TryReplaceSubPath(string data)
+ {
+ // Stupid, but it worked
+ var parts = data.Split(':');
+ if (parts.Length != 3)
+ {
+ return;
+ }
+
+ _ = PathExtensions.TryReplaceSubPath(parts[0], parts[1], parts[2], out _);
+ }
+ }
+}