mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 03:26:07 +02:00
34 lines
1,006 B
C#
34 lines
1,006 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using Jellyfin.Server.Middleware;
|
|||
|
using Microsoft.AspNetCore.Http;
|
|||
|
using Microsoft.AspNetCore.Http.Features;
|
|||
|
using Microsoft.Extensions.Primitives;
|
|||
|
using SharpFuzz;
|
|||
|
|
|||
|
namespace Emby.Server.Implementations.Fuzz
|
|||
|
{
|
|||
|
public static class Program
|
|||
|
{
|
|||
|
public static void Main(string[] args)
|
|||
|
{
|
|||
|
switch (args[0])
|
|||
|
{
|
|||
|
case "UrlDecodeQueryFeature": Run(UrlDecodeQueryFeature); return;
|
|||
|
default: throw new ArgumentException($"Unknown fuzzing function: {args[0]}");
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private static void Run(Action<string> action) => Fuzzer.OutOfProcess.Run(action);
|
|||
|
|
|||
|
private static void UrlDecodeQueryFeature(string data)
|
|||
|
{
|
|||
|
var dict = new Dictionary<string, StringValues>
|
|||
|
{
|
|||
|
{ data, StringValues.Empty }
|
|||
|
};
|
|||
|
_ = new UrlDecodeQueryFeature(new QueryFeature(new QueryCollection(dict)));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|