From c329df6019bff05f9989a43fa31bc7f894123807 Mon Sep 17 00:00:00 2001 From: Alexandr Lozovyuk Date: Sat, 16 Mar 2019 13:42:02 +0200 Subject: [PATCH] Update connection.js Fix Varint decode failing, if buffer empty (1 byte length). Minimal valid command length = 3 --- src/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connection.js b/src/connection.js index 93cfc55..f26a44d 100644 --- a/src/connection.js +++ b/src/connection.js @@ -66,7 +66,7 @@ class Connection extends EventEmitter { this.waiting = false this.stream.resume() - if (this.recvBuf.length > 0) { + if (this.recvBuf.length >= 3) { this.maybeReadNextMessage() } })