mirror of
https://github.com/deavminet/dnetd.git
synced 2025-02-21 15:06:57 +00:00
Fixed bug whereby DConnection thread would crash due to incorrect slicing indices
This commit is contained in:
parent
3716a6c583
commit
d18e6f4944
@ -169,7 +169,7 @@ public class DConnection : Thread
|
|||||||
byte usernameLength = message.data[1];
|
byte usernameLength = message.data[1];
|
||||||
|
|
||||||
/* Get the username and password */
|
/* Get the username and password */
|
||||||
string username = cast(string)message.data[2..usernameLength];
|
string username = cast(string)message.data[2..cast(ulong)2+usernameLength];
|
||||||
string password = cast(string)message.data[cast(ulong)2+usernameLength..message.data.length];
|
string password = cast(string)message.data[cast(ulong)2+usernameLength..message.data.length];
|
||||||
|
|
||||||
/* Authenticate */
|
/* Authenticate */
|
||||||
@ -182,6 +182,7 @@ public class DConnection : Thread
|
|||||||
|
|
||||||
/* Set the type of this connection to `client` */
|
/* Set the type of this connection to `client` */
|
||||||
connType = ConnectionType.CLIENT;
|
connType = ConnectionType.CLIENT;
|
||||||
|
hasAuthed = true;
|
||||||
|
|
||||||
/* Encode the reply */
|
/* Encode the reply */
|
||||||
byte[] reply = [status];
|
byte[] reply = [status];
|
||||||
|
Loading…
Reference in New Issue
Block a user