BufferedWriter.java (write(String,int,int)): Correctly check bounds.

* java/io/BufferedWriter.java (write(String,int,int)): Correctly
	check bounds.

From-SVN: r46338
This commit is contained in:
Tom Tromey 2001-10-18 23:43:59 +00:00 committed by Tom Tromey
parent 0d4903b81e
commit ac569f305c
2 changed files with 5 additions and 2 deletions

View 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'.

View 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)