mirror of
https://github.com/github/codeql.git
synced 2026-08-04 01:13:00 +02:00
15 lines
339 B
C#
15 lines
339 B
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.Serialization.Formatters.Binary;
|
|
|
|
class Bad
|
|
{
|
|
public static int InvokeSerialized(FileStream fs)
|
|
{
|
|
var formatter = new BinaryFormatter();
|
|
// BAD
|
|
var f = (Func<int>)formatter.Deserialize(fs); // $ Alert[cs/deserialized-delegate]
|
|
return f();
|
|
}
|
|
}
|