Skip to content

Commit

Permalink
Remvoed erroneous use of bit converter tochar in stun error attribute…
Browse files Browse the repository at this point in the history
… ctor. (#1235)
  • Loading branch information
sipsorcery authored Nov 19, 2024
1 parent bbf0867 commit 32f9a66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net/STUN/STUNAttributes/STUNErrorCodeAttribute.cs
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Filename: STUNErrorCodeAttribute.cs
//
// Description: Implements STUN error attribute as defined in RFC5389.
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 32f9a66

Please sign in to comment.