harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-1164) [classlib][luni] java.net.Socket.connect throws unexpected ArrayIndexOutOfBoundsException when the proxy server replies malformed message.
Date Wed, 16 Aug 2006 02:03:18 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1164?page=all ]

Paulex Yang closed HARMONY-1164.
--------------------------------


Verified by Andrew.

> [classlib][luni] java.net.Socket.connect throws unexpected ArrayIndexOutOfBoundsException
when the proxy server replies malformed message.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1164
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1164
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Andrew Zhang
>         Assigned To: Paulex Yang
>         Attachments: Harmony-1164.diff
>
>
> java.net.Socket.connect throws unexpected ArrayIndexOutOfBoundsException when the proxy
server replies malformed message. 
> Following test reproduces the bug:
> public void test_Socket() throws Exception {
>         final ServerSocket ss = new ServerSocket(0);
>         // Malformed proxy server thread
>         new Thread() {
>             public void run() {
>                 try {
>                     ss.accept().close();
>                 } catch (IOException e) {
>                     // ignore
>                 } finally {
>                     try {
>                         ss.close();
>                     } catch (IOException e) {
>                         // ignore
>                     }
>                 }
>             }
>         }.start();
>         SocketAddress addr = InetSocketAddress.createUnresolved("127.0.0.1", ss
>                 .getLocalPort());
>         Proxy proxy = new Proxy(Proxy.Type.SOCKS, addr);
>         Socket s = new Socket(proxy);
>         SocketAddress destAddress = new InetSocketAddress("127.0.0.1", 2000);
>         try {
>             s.connect(destAddress);
>             fail("should throw SocketException");
>         } catch (SocketException e) {
>             // expected
>         }
>     }
> The test passes against RI while fails against Harmony.
> I'll upload a patch to fix this problem soon. Thanks!
> Best regards,
> Andrew

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message