I am receiving an error on my C# Console Application. I am trying to do some code but its throwing an exception whenever I do so, not all the time just some of the time, by the way it is not just me using this program there is 30+ members on it using it also.
Code:
int MessageLength = Base64Encoding.DecodeInt32(new byte[] { data[pos++], data[pos++], data[pos++] });
int MessageId = Base64Encoding.DecodeInt32(new byte[] { data[pos++], data[pos++] });
byte[] Content = new byte[MessageLength - 2];
The Exception is:
Exception logged 1/23/2015 10:54:54 AM in packet handling: System.OverflowException: Arithmetic operation resulted in an overflow.
The exception is happening on line 37, the following line...
byte[] Content = new byte[MessageLength - 2];
Here is a image of the lengths changing of 'pos' and 'MessgaeLength'

MessageLength?pos?