diff options
author | Myles Borins <mborins@us.ibm.com> | 2016-02-03 16:07:44 -0800 |
---|---|---|
committer | Myles Borins <mborins@us.ibm.com> | 2016-02-05 13:58:50 -0800 |
commit | 878bcd43f8f9d3ec0d3403cb1bbe1ba6201a6d84 (patch) | |
tree | 53a57b7dadb9a21f098de288cac1ed93b270c7ff /lib/querystring.js | |
parent | 1124de2d76ad7118267d91a08485aa928a5f0865 (diff) | |
download | android-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.js | 2 |
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); |