From e4ddea52673a53d7f3e935e30740d7990efdb91d Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 28 Aug 2024 16:17:52 +1000 Subject: [PATCH] Add check to make sure the size of the consent UI header is at least the size of the header as known for the platform/OS version --- src/Lithnet.CredentialProvider/ConsentUI/ConsentUIData.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Lithnet.CredentialProvider/ConsentUI/ConsentUIData.cs b/src/Lithnet.CredentialProvider/ConsentUI/ConsentUIData.cs index 37596df..55da8fb 100644 --- a/src/Lithnet.CredentialProvider/ConsentUI/ConsentUIData.cs +++ b/src/Lithnet.CredentialProvider/ConsentUI/ConsentUIData.cs @@ -73,6 +73,11 @@ namespace Lithnet.CredentialProvider { throw new InvalidDataException($"The size of the data structure {this.header.Size} does not match the expected size {expectedSize}"); } + + if (HeaderSize > this.header.Size) + { + throw new InvalidDataException($"The size of the data structure {this.header.Size} is less than the expected header size {HeaderSize}"); + } } ///