mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-01 15:33:50 +00:00
count length bit when checking buffer size
This commit is contained in:
+2
-2
@@ -588,8 +588,8 @@ server_recv_cb(EV_P_ ev_io *w, int revents)
|
||||
}
|
||||
} else if (atyp == 3) {
|
||||
// Domain name
|
||||
uint8_t name_len = *(uint8_t *)(buf->data + 4);
|
||||
if (buf->len < request_len + name_len + 2) {
|
||||
uint8_t name_len = *(uint8_t *)(buf->data + request_len);
|
||||
if (buf->len < request_len + 1 + name_len + 2) {
|
||||
return;
|
||||
}
|
||||
abuf->data[abuf->len++] = name_len;
|
||||
|
||||
Reference in New Issue
Block a user