From c58c3595194e2ce9fbd2cea887b7bcab8b07337f Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Tue, 11 May 2021 13:04:09 +0200 Subject: [PATCH] limit max pong to 32 bytes --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0036514..7aa8908 100644 --- a/index.js +++ b/index.js @@ -499,7 +499,7 @@ class DHT extends EventEmitter { // echo the value back if (req.command === 'ping') { - this._reply(req.tid, null, 0, req.value, req.from, false) + if (req.value === null || req.value.byteLength <= 32) this._reply(req.tid, null, 0, req.value, req.from, false) return }