BufferedWriter.java (write(String,int,int)): Correctly check bounds.
authorTom Tromey <tromey@redhat.com>
Thu, 18 Oct 2001 23:43:59 +0000 (23:43 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 18 Oct 2001 23:43:59 +0000 (23:43 +0000)
* java/io/BufferedWriter.java (write(String,int,int)): Correctly
check bounds.

From-SVN: r46338

libjava/ChangeLog
libjava/java/io/BufferedWriter.java

index 1fd3a3331ab6f08510c11e45e14e922165cda880..6e3b562ad6713e1f6ed90f5ad4f53a46e1d9f052 100644 (file)
@@ -1,5 +1,8 @@
 2001-10-18  Tom Tromey  <tromey@redhat.com>
 
+       * java/io/BufferedWriter.java (write(String,int,int)): Correctly
+       check bounds.
+
        * java/security/Security.java (loadProviders): Removed unused
        `pname' variable.  Don't create `File' object.  Don't update
        `providerCount'.
index e99586121dbe8cdd0a880136929cf1407d4eac9a..ef12bd56745e41a4548e49edc1ee29189cd840ca 100644 (file)
@@ -1,5 +1,5 @@
 /* BufferedWriter.java -- Buffer output into large blocks before writing
-   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -199,7 +199,7 @@ public class BufferedWriter extends Writer
    */
   public void write (String str, int offset, int len) throws IOException
   {
-    if (offset < 0 || len < 0 || offset + len < str.length())
+    if (offset < 0 || len < 0 || offset + len > str.length())
       throw new ArrayIndexOutOfBoundsException ();
 
     synchronized (lock)