Permalink
Browse files

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

Potential fix for #3148.
  • Loading branch information...
1 parent 0fcb124 commit 142e8caa9febf1bfa816af8311d5fa913b82d4e0 @TooTallNate committed Apr 21, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/net.js
View
2 lib/net.js
@@ -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;
}

0 comments on commit 142e8ca

Please sign in to comment.