From 98af57041d51b34b3f511c76748d77e11ebcffc6 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 25 Sep 2019 13:48:33 +0800 Subject: [PATCH] =?UTF-8?q?websocketsession=E6=B7=BB=E5=8A=A0=E9=98=B2?= =?UTF-8?q?=E5=BE=A1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a8/websocketsession.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/a8/websocketsession.cc b/a8/websocketsession.cc index 5a98afd..14192f1 100644 --- a/a8/websocketsession.cc +++ b/a8/websocketsession.cc @@ -191,6 +191,9 @@ namespace a8 void WebSocketSession::DecodeFrame(char* buf, int& offset, unsigned int buflen) { + if (offset + 2 < buflen) { + return; + } char* real_buf = buf + offset; unsigned int ava_len = buflen - offset; char header = real_buf[0];