Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  lib/net.js
2  lib/net.js
@@ -940,7 +940,7 @@ exports.isIP = function(input) {
940 940 } else if (/^(\d?\d?\d)\.(\d?\d?\d)\.(\d?\d?\d)\.(\d?\d?\d)$/.test(input)) {
941 941 var parts = input.split('.');
942 942 for (var i = 0; i < parts.length; i++) {
943   - var part = parseInt(parts[i]);
  943 + var part = parseInt(parts[i], 10);
944 944 if (part < 0 || 255 < part) {
945 945 return 0;
946 946 }

0 comments on commit 142e8ca

Please sign in to comment.
Something went wrong with that request. Please try again.