This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: unidiff version of the last patch I submitted
>>>>> "Tony" == Tony Kimball <alk@pobox.com> writes:
I started looking at the other part of this patch.
I don't understand this code:
Tony> + if (p == null) {
Tony> + SecurityManager s = System.getSecurityManager();
Tony> + if (s != null)
Tony> + s.checkAccept(p.getAddress().getHostAddress(), p.getPort());
Tony> + } else if ((p.getPort() != remotePort || !p.getAddress().equals(remoteAddr))) {
Tony> + throw new IllegalArgumentException("Inconsistent packet address for connection to "
Tony> + +remoteAddr+" port "+remotePort);
Tony> + }
In the p==null case we proceed to dereference p. I think that is a
bug. Should the security check be done unconditionally?
Tom