From 32f9a66a7875843d7976923629837be2807b7f81 Mon Sep 17 00:00:00 2001 From: Aaron Clauson Date: Tue, 19 Nov 2024 21:02:17 +0000 Subject: [PATCH] Remvoed erroneous use of bit converter tochar in stun error attribute ctor. (#1235) --- src/net/STUN/STUNAttributes/STUNErrorCodeAttribute.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 src/net/STUN/STUNAttributes/STUNErrorCodeAttribute.cs diff --git a/src/net/STUN/STUNAttributes/STUNErrorCodeAttribute.cs b/src/net/STUN/STUNAttributes/STUNErrorCodeAttribute.cs old mode 100644 new mode 100755 index 09bbb44bf..b97bedb81 --- a/src/net/STUN/STUNAttributes/STUNErrorCodeAttribute.cs +++ b/src/net/STUN/STUNAttributes/STUNErrorCodeAttribute.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Filename: STUNErrorCodeAttribute.cs // // Description: Implements STUN error attribute as defined in RFC5389. @@ -35,8 +35,8 @@ public int ErrorCode public STUNErrorCodeAttribute(byte[] attributeValue) : base(STUNAttributeTypesEnum.ErrorCode, attributeValue) { - ErrorClass = (byte)BitConverter.ToChar(attributeValue, 2); - ErrorNumber = (byte)BitConverter.ToChar(attributeValue, 3); + ErrorClass = attributeValue[2]; + ErrorNumber = attributeValue[3]; ReasonPhrase = Encoding.UTF8.GetString(attributeValue, 4, attributeValue.Length - 4); }