File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -401,7 +401,7 @@ private static void ReceiveCallback(IAsyncResult ar)
401401
402402 int messageType = mr . Read < int > ( ) ;
403403 int messageLength = mr . Read < int > ( ) ;
404- if ( messageType > ( Enum . GetNames ( typeof ( ClientMessageType ) ) . Length - 1 ) )
404+ if ( messageType < 0 || messageType > ( Enum . GetNames ( typeof ( ClientMessageType ) ) . Length - 1 ) )
405405 {
406406 //Malformed message, most likely from a non DMP-client.
407407 Messages . ConnectionEnd . SendConnectionEnd ( client , "Invalid DMP message. Disconnected." ) ;
@@ -421,7 +421,7 @@ private static void ReceiveCallback(IAsyncResult ar)
421421 }
422422 else
423423 {
424- if ( messageLength < Common . MAX_MESSAGE_SIZE )
424+ if ( messageLength > 0 && messageLength < Common . MAX_MESSAGE_SIZE )
425425 {
426426 client . isReceivingMessage = true ;
427427 client . receiveMessage . data = new byte [ messageLength ] ;
You can’t perform that action at this time.
0 commit comments