Fri, 24 Sep 2010 22:42:14 -0700
6891766: Vulnerabilities in use of reflection in CORBA
Reviewed-by: hawtin
duke@1 | 1 | /* |
ohair@158 | 2 | * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@158 | 7 | * published by the Free Software Foundation. Oracle designates this |
duke@1 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@158 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
duke@1 | 10 | * |
duke@1 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | * accompanied this code). |
duke@1 | 16 | * |
duke@1 | 17 | * You should have received a copy of the GNU General Public License version |
duke@1 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | * |
ohair@158 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@158 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@158 | 23 | * questions. |
duke@1 | 24 | */ |
duke@1 | 25 | /* |
duke@1 | 26 | * File: ./org/omg/CosNaming/_BindingIteratorImplBase.java |
duke@1 | 27 | * From: nameservice.idl |
duke@1 | 28 | * Date: Tue Aug 11 03:12:09 1998 |
duke@1 | 29 | * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 |
duke@1 | 30 | * @deprecated Deprecated in JDK 1.4. |
duke@1 | 31 | */ |
duke@1 | 32 | |
duke@1 | 33 | package org.omg.CosNaming; |
duke@1 | 34 | public abstract class _BindingIteratorImplBase extends org.omg.CORBA.DynamicImplementation implements org.omg.CosNaming.BindingIterator { |
duke@1 | 35 | // Constructor |
duke@1 | 36 | public _BindingIteratorImplBase() { |
duke@1 | 37 | super(); |
duke@1 | 38 | } |
duke@1 | 39 | // Type strings for this class and its superclases |
duke@1 | 40 | private static final String _type_ids[] = { |
duke@1 | 41 | "IDL:omg.org/CosNaming/BindingIterator:1.0" |
duke@1 | 42 | }; |
duke@1 | 43 | |
duke@1 | 44 | public String[] _ids() { return (String[]) _type_ids.clone(); } |
duke@1 | 45 | |
duke@1 | 46 | private static java.util.Dictionary _methods = new java.util.Hashtable(); |
duke@1 | 47 | static { |
duke@1 | 48 | _methods.put("next_one", new java.lang.Integer(0)); |
duke@1 | 49 | _methods.put("next_n", new java.lang.Integer(1)); |
duke@1 | 50 | _methods.put("destroy", new java.lang.Integer(2)); |
duke@1 | 51 | } |
duke@1 | 52 | // DSI Dispatch call |
duke@1 | 53 | public void invoke(org.omg.CORBA.ServerRequest r) { |
duke@1 | 54 | switch (((java.lang.Integer) _methods.get(r.op_name())).intValue()) { |
duke@1 | 55 | case 0: // org.omg.CosNaming.BindingIterator.next_one |
duke@1 | 56 | { |
duke@1 | 57 | org.omg.CORBA.NVList _list = _orb().create_list(0); |
duke@1 | 58 | org.omg.CORBA.Any _b = _orb().create_any(); |
duke@1 | 59 | _b.type(org.omg.CosNaming.BindingHelper.type()); |
duke@1 | 60 | _list.add_value("b", _b, org.omg.CORBA.ARG_OUT.value); |
duke@1 | 61 | r.params(_list); |
duke@1 | 62 | org.omg.CosNaming.BindingHolder b; |
duke@1 | 63 | b = new org.omg.CosNaming.BindingHolder(); |
duke@1 | 64 | boolean ___result; |
duke@1 | 65 | ___result = this.next_one(b); |
duke@1 | 66 | org.omg.CosNaming.BindingHelper.insert(_b, b.value); |
duke@1 | 67 | org.omg.CORBA.Any __result = _orb().create_any(); |
duke@1 | 68 | __result.insert_boolean(___result); |
duke@1 | 69 | r.result(__result); |
duke@1 | 70 | } |
duke@1 | 71 | break; |
duke@1 | 72 | case 1: // org.omg.CosNaming.BindingIterator.next_n |
duke@1 | 73 | { |
duke@1 | 74 | org.omg.CORBA.NVList _list = _orb().create_list(0); |
duke@1 | 75 | org.omg.CORBA.Any _how_many = _orb().create_any(); |
duke@1 | 76 | _how_many.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)); |
duke@1 | 77 | _list.add_value("how_many", _how_many, org.omg.CORBA.ARG_IN.value); |
duke@1 | 78 | org.omg.CORBA.Any _bl = _orb().create_any(); |
duke@1 | 79 | _bl.type(org.omg.CosNaming.BindingListHelper.type()); |
duke@1 | 80 | _list.add_value("bl", _bl, org.omg.CORBA.ARG_OUT.value); |
duke@1 | 81 | r.params(_list); |
duke@1 | 82 | int how_many; |
duke@1 | 83 | how_many = _how_many.extract_ulong(); |
duke@1 | 84 | org.omg.CosNaming.BindingListHolder bl; |
duke@1 | 85 | bl = new org.omg.CosNaming.BindingListHolder(); |
duke@1 | 86 | boolean ___result; |
duke@1 | 87 | ___result = this.next_n(how_many, bl); |
duke@1 | 88 | org.omg.CosNaming.BindingListHelper.insert(_bl, bl.value); |
duke@1 | 89 | org.omg.CORBA.Any __result = _orb().create_any(); |
duke@1 | 90 | __result.insert_boolean(___result); |
duke@1 | 91 | r.result(__result); |
duke@1 | 92 | } |
duke@1 | 93 | break; |
duke@1 | 94 | case 2: // org.omg.CosNaming.BindingIterator.destroy |
duke@1 | 95 | { |
duke@1 | 96 | org.omg.CORBA.NVList _list = _orb().create_list(0); |
duke@1 | 97 | r.params(_list); |
duke@1 | 98 | this.destroy(); |
duke@1 | 99 | org.omg.CORBA.Any __return = _orb().create_any(); |
duke@1 | 100 | __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); |
duke@1 | 101 | r.result(__return); |
duke@1 | 102 | } |
duke@1 | 103 | break; |
duke@1 | 104 | default: |
duke@1 | 105 | throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); |
duke@1 | 106 | } |
duke@1 | 107 | } |
duke@1 | 108 | } |