CLOUDSTACK-8329: CloudStack accepts IP ends with dot

This commit is contained in:
Wei Zhou 2015-03-16 12:58:07 +01:00
parent 5a860fe0ae
commit 75da05068a
1 changed files with 4 additions and 0 deletions

View File

@ -515,6 +515,10 @@ public class NetUtils {
}
public static boolean isValidIp(final String ip) {
if (ip.endsWith(".")) {
return false;
}
final String[] ipAsList = ip.split("\\.");
// The IP address must have four octets