diff -r fd5d08550d66 -r a00341fc41db jdk/src/share/classes/java/net/SocketPermission.java --- a/jdk/src/share/classes/java/net/SocketPermission.java Mon Jul 18 13:10:02 2011 +0100 +++ b/jdk/src/share/classes/java/net/SocketPermission.java Mon Jul 18 22:25:58 2011 +0100 @@ -956,10 +956,16 @@ String thisHost = hostname; String thatHost = that.hostname; - if (thisHost == null) + if (thisHost == null) { return false; - else + } else if (this.wildcard) { + final int cnameLength = this.cname.length(); + return thatHost.regionMatches(true, + (thatHost.length() - cnameLength), + this.cname, 0, cnameLength); + } else { return thisHost.equalsIgnoreCase(thatHost); + } } /**