unidiff version of the last patch I submitted

Tom Tromey tromey@redhat.com
Wed Jul 24 21:10:00 GMT 2002


>>>>> "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



More information about the Java-patches mailing list