From 37abe764ba46e26da069751971e8944a9baa8c21 Mon Sep 17 00:00:00 2001 From: Sinux Date: Tue, 24 May 2016 16:21:26 +0800 Subject: [PATCH] Connection: validate whether uid and seqno is positive --- lib/Connection.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Connection.js b/lib/Connection.js index 292d854..a62efce 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -1818,8 +1818,15 @@ function validateUIDList(uids, noThrow) { return err; else throw err; - } else if (typeof uids[i] !== 'number') + } else if (intval <= 0) { + var err = new Error('UID/seqno must be greater than zero'); + if (noThrow) + return err; + else + throw err; + } else if (typeof uids[i] !== 'number') { uids[i] = intval; + } } }