You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2010/05/01 18:02:56 UTC

[jira] Created: (HTTPCLIENT-932) SSLSocketFactory.connectSocket(...) possible NPE

SSLSocketFactory.connectSocket(...) possible NPE
------------------------------------------------

                 Key: HTTPCLIENT-932
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-932
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
            Reporter: Sebb


    public Socket connectSocket(
            final Socket sock,
            final InetSocketAddress remoteAddress,
            final InetSocketAddress localAddress,
            final HttpParams params) throws IOException, UnknownHostException, ConnectTimeoutException {
...

        SSLSocket sslsock = (SSLSocket) (sock != null ? sock : createSocket()); // ==> sock may be null
        if (localAddress != null) {
            sock.setReuseAddress(HttpConnectionParams.getSoReuseaddr(params)); // ==> NPE if sock is null
            sslsock.bind(localAddress);
        }

Should sock.setReuseAddress be sslsock.setReuseAddress?


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-932) SSLSocketFactory.connectSocket(...) possible NPE

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12863023#action_12863023 ] 

Oleg Kalnichevski commented on HTTPCLIENT-932:
----------------------------------------------

Yep, this is obviously wrong. Please do feel free to go ahead and apply a fix. 

Oleg 

> SSLSocketFactory.connectSocket(...) possible NPE
> ------------------------------------------------
>
>                 Key: HTTPCLIENT-932
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-932
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>            Reporter: Sebb
>
>     public Socket connectSocket(
>             final Socket sock,
>             final InetSocketAddress remoteAddress,
>             final InetSocketAddress localAddress,
>             final HttpParams params) throws IOException, UnknownHostException, ConnectTimeoutException {
> ...
>         SSLSocket sslsock = (SSLSocket) (sock != null ? sock : createSocket()); // ==> sock may be null
>         if (localAddress != null) {
>             sock.setReuseAddress(HttpConnectionParams.getSoReuseaddr(params)); // ==> NPE if sock is null
>             sslsock.bind(localAddress);
>         }
> Should sock.setReuseAddress be sslsock.setReuseAddress?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCLIENT-932) SSLSocketFactory.connectSocket(...) possible NPE

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved HTTPCLIENT-932.
-----------------------------

    Resolution: Fixed

Fixed, see commit history

> SSLSocketFactory.connectSocket(...) possible NPE
> ------------------------------------------------
>
>                 Key: HTTPCLIENT-932
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-932
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>            Reporter: Sebb
>
>     public Socket connectSocket(
>             final Socket sock,
>             final InetSocketAddress remoteAddress,
>             final InetSocketAddress localAddress,
>             final HttpParams params) throws IOException, UnknownHostException, ConnectTimeoutException {
> ...
>         SSLSocket sslsock = (SSLSocket) (sock != null ? sock : createSocket()); // ==> sock may be null
>         if (localAddress != null) {
>             sock.setReuseAddress(HttpConnectionParams.getSoReuseaddr(params)); // ==> NPE if sock is null
>             sslsock.bind(localAddress);
>         }
> Should sock.setReuseAddress be sslsock.setReuseAddress?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org