From 714a32c41f7cedec76cd7a237ac12f4cee7fcf85 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 31 May 2019 20:36:23 +0200 Subject: net: make writeAfterFIN() return false If `false` is not returned a readable stream piped into the socket might continue reading indefinitely until the process goes out of memory. PR-URL: https://github.com/nodejs/node/pull/27996 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig --- lib/net.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/net.js') diff --git a/lib/net.js b/lib/net.js index 54ddaa3b40..6c2bf56875 100644 --- a/lib/net.js +++ b/lib/net.js @@ -410,6 +410,8 @@ function writeAfterFIN(chunk, encoding, cb) { if (typeof cb === 'function') { defaultTriggerAsyncIdScope(this[async_id_symbol], process.nextTick, cb, er); } + + return false; } Socket.prototype.setTimeout = setStreamTimeout; -- cgit v1.2.3