Skip to content

Commit 969ce56

Browse files
committed
[System.DirectoryServices.Protocols] Fix overflow in ProtocolVersion on Big Endian
1 parent b091d4d commit 969ce56

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.ComponentModel;
55
using System.IO;
66
using System.Runtime.Versioning;
7+
using System.Buffers.Binary;
78

89
namespace System.DirectoryServices.Protocols
910
{
@@ -57,8 +58,9 @@ public bool SecureSocketLayer
5758

5859
public int ProtocolVersion
5960
{
60-
get => GetPtrValueHelper(LdapOption.LDAP_OPT_VERSION).ToInt32();
61-
set => SetPtrValueHelper(LdapOption.LDAP_OPT_VERSION, new IntPtr(value));
61+
get => GetIntValueHelper(LdapOption.LDAP_OPT_VERSION);
62+
63+
set => SetIntValueHelper(LdapOption.LDAP_OPT_VERSION, value);
6264
}
6365

6466
public ReferralChasingOptions ReferralChasing

0 commit comments

Comments
 (0)