Fix issue with analysis of IPv6 mapper IPv4

This commit is contained in:
Juan Martín Sotuyo Dodero
2020-01-04 04:37:13 -03:00
parent 3b8d694be3
commit caaa5eba9a

View File

@ -108,7 +108,7 @@ public class AvoidUsingHardCodedIPRule extends AbstractJavaRule {
}
protected boolean isHexCharacter(char c) {
return isLatinDigit(c) || 'A' <= c && c <= 'F' || 'a' <= c && c <= 'f';
return isLatinDigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
}
protected boolean isIPv4(final char firstChar, final String s) {
@ -190,7 +190,7 @@ public class AvoidUsingHardCodedIPRule extends AbstractJavaRule {
}
} catch (NumberFormatException e) {
// The last part can be a standard IPv4 address.
if (i != parts.length - 1 || !isIPv4(firstChar, part)) {
if (i != parts.length - 1 || !isIPv4(part.charAt(0), part)) {
return false;
}
ipv4Mapped = true;