817N/A/*
2362N/A * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
817N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
817N/A *
817N/A * This code is free software; you can redistribute it and/or modify it
817N/A * under the terms of the GNU General Public License version 2 only, as
817N/A * published by the Free Software Foundation.
817N/A *
817N/A * This code is distributed in the hope that it will be useful, but WITHOUT
817N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
817N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
817N/A * version 2 for more details (a copy is included in the LICENSE file that
817N/A * accompanied this code).
817N/A *
817N/A * You should have received a copy of the GNU General Public License version
817N/A * 2 along with this work; if not, write to the Free Software Foundation,
817N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
817N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
817N/A */
817N/A
817N/A/*
817N/A * @test
1280N/A * @bug 4827312 6850113
817N/A * @summary verify that argument validity check is not fooled by overflow
817N/A */
817N/Apublic class BidiBug {
817N/A public static void main(String[] args) {
817N/A try {
817N/A byte buff[] = new byte[3000];
817N/A java.text.Bidi bidi = new java.text.Bidi(new char[20],10,buff,Integer.MAX_VALUE-3,4,1);
817N/A }
817N/A catch (IllegalArgumentException e) {
1280N/A System.out.println("Passed: " + e);
817N/A return; // success
817N/A }
1280N/A throw new RuntimeException("Failed: Bidi didn't throw error, though we didn't crash either");
817N/A }
817N/A}