re PR libgcj/21074 (Trivial bug in the method getHeaderFieldKey() in the file java...
authorGoffredo Baroncelli <kreijack@inwind.it>
Wed, 15 Jun 2005 20:08:27 +0000 (22:08 +0200)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 15 Jun 2005 20:08:27 +0000 (20:08 +0000)
2005-06-15  Goffredo Baroncelli  <kreijack@inwind.it>

PR libgcj/21074:
* gnu/java/net/protocol/http/HTTPURLConnection.java
(getHeaderFieldKey): Check index.

From-SVN: r100994

libjava/ChangeLog
libjava/gnu/java/net/protocol/http/HTTPURLConnection.java

index 813eef1db912b82613125fb92ffd1371099c0fad..d2653a42328e9f8193ae56c57702952459430271 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-15  Goffredo Baroncelli  <kreijack@inwind.it>
+
+       PR libgcj/21074:
+       * gnu/java/net/protocol/http/HTTPURLConnection.java
+       (getHeaderFieldKey): Check index.
+
 2005-06-15  Tom Tromey  <tromey@redhat.com>
 
        PR libgcj/21906:
index 50a6ed12e7a0320346e5a89eb97f1418190c7dc1..b82d30f5ae6496b178e0ac7838faf148197d4976 100644 (file)
@@ -1,5 +1,5 @@
 /* HTTPURLConnection.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -572,6 +572,10 @@ public class HTTPURLConnection
     int count = 1;
     do
       {
+        if (!i.hasNext())
+          {
+            return null;
+          }
         entry = (Map.Entry) i.next();
         count++;
       }