diff options
| author | cvium <clausvium@gmail.com> | 2021-09-03 21:25:18 +0200 |
|---|---|---|
| committer | cvium <clausvium@gmail.com> | 2021-09-03 21:25:18 +0200 |
| commit | 048c478b0d9fbad3c7e6ef7fcbf8e6c2b91fc013 (patch) | |
| tree | e30a5eba97deff4b82a89099d802e06a67ae329c /fuzz/Emby.Server.Implementations.Fuzz/Program.cs | |
| parent | 02a56d8cf73e6745f651fe230520182f0398fae3 (diff) | |
| parent | e83d7a866750405f790cc261d1894dc51c088bf4 (diff) | |
Merge branch 'master' into bug/authorization-header-issue
Diffstat (limited to 'fuzz/Emby.Server.Implementations.Fuzz/Program.cs')
| -rw-r--r-- | fuzz/Emby.Server.Implementations.Fuzz/Program.cs | 32 |
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 _); + } + } +} |
