summaryrefslogtreecommitdiff
path: root/lib/querystring.js
diff options
context:
space:
mode:
authorMyles Borins <mborins@us.ibm.com>2016-02-03 16:07:44 -0800
committerMyles Borins <mborins@us.ibm.com>2016-02-05 13:58:50 -0800
commit878bcd43f8f9d3ec0d3403cb1bbe1ba6201a6d84 (patch)
tree53a57b7dadb9a21f098de288cac1ed93b270c7ff /lib/querystring.js
parent1124de2d76ad7118267d91a08485aa928a5f0865 (diff)
downloadandroid-node-v8-878bcd43f8f9d3ec0d3403cb1bbe1ba6201a6d84.tar.gz
android-node-v8-878bcd43f8f9d3ec0d3403cb1bbe1ba6201a6d84.tar.bz2
android-node-v8-878bcd43f8f9d3ec0d3403cb1bbe1ba6201a6d84.zip
querystring: check that maxKeys is finite
There was a very subtle change in behavior introduced with 27def4f In the past if querystring.parse was given Infinity for maxKeys, everything worked as expected. Check to see is maxKeys is Infinity before forwarding the value to String.prototype.split which causes this regression PR-URL: https://github.com/nodejs/node/pull/5066 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'lib/querystring.js')
-rw-r--r--lib/querystring.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/querystring.js b/lib/querystring.js
index d5d4f175b6..4244d8c18b 100644
--- a/lib/querystring.js
+++ b/lib/querystring.js
@@ -215,7 +215,7 @@ QueryString.parse = QueryString.decode = function(qs, sep, eq, options) {
}
// maxKeys <= 0 means that we should not limit keys count
- if (maxKeys > 0) {
+ if (maxKeys > 0 && isFinite(maxKeys)) {
qs = qs.split(sep, maxKeys);
} else {
qs = qs.split(sep);