This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: FYI: BufferedWriter fix


I'm checking this in.  This fixes a bug reported on the main list.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* java/io/BufferedWriter.java (write(String,int,int)): Correctly
	check bounds.

Index: java/io/BufferedWriter.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/BufferedWriter.java,v
retrieving revision 1.5
diff -u -r1.5 BufferedWriter.java
--- java/io/BufferedWriter.java 2001/02/20 19:01:55 1.5
+++ java/io/BufferedWriter.java 2001/10/18 23:41:56
@@ -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 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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]