You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2006/08/16 04:03:18 UTC
[jira] Closed: (HARMONY-1164) [classlib][luni]
java.net.Socket.connect throws unexpected ArrayIndexOutOfBoundsException
when the proxy server replies malformed message.
[ 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