Skip to content

Commit

Permalink
Adds missing warning code for suppresion
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) committed Feb 29, 2024
1 parent 0fe825d commit d7f92ce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ private static T RoundtripSerialize<T>(T source)
BinaryFormatter formatter = new(); // CodeQL [SM04191] : This is a test. Safe use because the deserialization process is performed on trusted data and the types are controlled and validated.
formatter.Serialize(stream, source);
stream.Position = 0;
// cs/dangerous-binary-deserialization
return (T)formatter.Deserialize(stream); // CodeQL [SM03722] : Testing legacy feature. This is a safe use of BinaryFormatter because the data is trusted and the types are controlled and validated.
// cs/dangerous-binary-deserialization, cs/deserialization-unexpected-subtypes
return (T)formatter.Deserialize(stream); // CodeQL [SM03722, SM02229] : Testing legacy feature. This is a safe use of BinaryFormatter because the data is trusted and the types are controlled and validated.
#pragma warning restore SYSLIB0011 // Type or member is obsolete
}

Expand Down

0 comments on commit d7f92ce

Please sign in to comment.