X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web.Security%2FFormsAuthenticationTicket.cs;h=5adad7863bb14a5cf00698c61b9a2e0b4ca22e53;hb=43f369a1073652cb211aea5bff28743ab7879f47;hp=cb108d98c40cb55e33d4861860af6a31d3ac6577;hpb=bd9f9ee7cb81823608edc76ef9d0b6416783fe71;p=mono.git diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationTicket.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationTicket.cs index cb108d98c40..5adad7863bb 100644 --- a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationTicket.cs +++ b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationTicket.cs @@ -29,11 +29,14 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.IO; +using System.Security.Permissions; namespace System.Web.Security { + // CAS - no InheritanceDemand here as the class is sealed + [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] + // attributes [Serializable] public sealed class FormsAuthenticationTicket { @@ -84,6 +87,9 @@ namespace System.Web.Security internal static FormsAuthenticationTicket FromByteArray (byte [] bytes) { + if (bytes == null) + throw new ArgumentNullException ("bytes"); + MemoryStream ms = new MemoryStream (bytes); BinaryReader reader = new BinaryReader (ms); FormsAuthenticationTicket ticket = new FormsAuthenticationTicket (); @@ -103,7 +109,7 @@ namespace System.Web.Security return ticket; } - private FormsAuthenticationTicket () + FormsAuthenticationTicket () { }