Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

net: specify a radix of 10 for parseInt() in isIP()

Potential fix for #3148.
  • Loading branch information...
commit 142e8caa9febf1bfa816af8311d5fa913b82d4e0 1 parent 0fcb124
Nathan Rajlich authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/net.js
2  lib/net.js
View
@@ -940,7 +940,7 @@ exports.isIP = function(input) {
} else if (/^(\d?\d?\d)\.(\d?\d?\d)\.(\d?\d?\d)\.(\d?\d?\d)$/.test(input)) {
var parts = input.split('.');
for (var i = 0; i < parts.length; i++) {
- var part = parseInt(parts[i]);
+ var part = parseInt(parts[i], 10);
if (part < 0 || 255 < part) {
return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.