瀏覽代碼

added header check.

Nicolas Cannasse 18 年之前
父節點
當前提交
a9e0f18a4b
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      std/neko/net/ThreadRemotingServer.hx

+ 2 - 0
std/neko/net/ThreadRemotingServer.hx

@@ -70,6 +70,8 @@ class ThreadRemotingServer extends ThreadServer<haxe.remoting.SocketConnection,S
 	public override function readClientMessage( cnx, buf : String, pos : Int, len : Int ) {
 		var c1 = decodeChar(buf.charCodeAt(pos));
 		var c2 = decodeChar(buf.charCodeAt(pos+1));
+		if( c1 == null || c2 == null )
+			throw "Invalid remoting message '"+buf.substr(pos,len)+"'";
 		var msgLen = (c1 << 6) | c2;
 		if( len < msgLen )
 			return null;