Skip to content

Commit d086ec6

Browse files
authored
[System.DirectoryServices.Protocols] Fix ProtocolVersion Overflow on Big Endian Systems (#112391)
1 parent 6e06aef commit d086ec6

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ public bool SecureSocketLayer
5555
}
5656
}
5757

58-
public int ProtocolVersion
59-
{
60-
get => GetPtrValueHelper(LdapOption.LDAP_OPT_VERSION).ToInt32();
61-
set => SetPtrValueHelper(LdapOption.LDAP_OPT_VERSION, new IntPtr(value));
62-
}
63-
6458
public ReferralChasingOptions ReferralChasing
6559
{
6660
get

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ public bool SecureSocketLayer
3434
[UnsupportedOSPlatform("windows")]
3535
public void StartNewTlsSessionContext() => throw new PlatformNotSupportedException();
3636

37-
public int ProtocolVersion
38-
{
39-
get => GetIntValueHelper(LdapOption.LDAP_OPT_VERSION);
40-
set => SetIntValueHelper(LdapOption.LDAP_OPT_VERSION, value);
41-
}
42-
4337
public ReferralChasingOptions ReferralChasing
4438
{
4539
get

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,12 @@ public void StopTransportLayerSecurity()
757757
}
758758
}
759759

760+
public int ProtocolVersion
761+
{
762+
get => GetIntValueHelper(LdapOption.LDAP_OPT_VERSION);
763+
set => SetIntValueHelper(LdapOption.LDAP_OPT_VERSION, value);
764+
}
765+
760766
private int GetIntValueHelper(LdapOption option)
761767
{
762768
if (_connection._disposed)

0 commit comments

Comments
 (0)