Fixed an issue in NetGetData where e.Length - 1 would be -1
This commit is contained in:
parent
4ff861634c
commit
8f8e9d4cd4
1 changed files with 5 additions and 0 deletions
|
|
@ -1274,6 +1274,11 @@ namespace TShockAPI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int length = e.Length - 1;
|
||||||
|
if (length < 0)
|
||||||
|
{
|
||||||
|
length = 0;
|
||||||
|
}
|
||||||
using (var data = new MemoryStream(e.Msg.readBuffer, e.Index, e.Length - 1))
|
using (var data = new MemoryStream(e.Msg.readBuffer, e.Index, e.Length - 1))
|
||||||
{
|
{
|
||||||
// Exceptions are already handled
|
// Exceptions are already handled
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue