This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: BufferedWriter fix
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: Patch: FYI: BufferedWriter fix
- From: Tom Tromey <tromey at redhat dot com>
- Date: 18 Oct 2001 17:59:50 -0600
- Reply-To: tromey at redhat dot com
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)