[ 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to