classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Patch: RFC: copy bytes in defineClass


From: Tom Tromey
Subject: Re: [cp-patches] Patch: RFC: copy bytes in defineClass
Date: 12 Aug 2004 11:23:04 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Archie" == Archie Cobbs <address@hidden> writes:

Archie> However, I agree with you that at least a comment should be added,
Archie> and that the "trusted code" argument is not sufficient.

I'm checking this in instead.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * vm/reference/java/lang/VMClassLoader.java: Added security
        comment.

Index: vm/reference/java/lang/VMClassLoader.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/vm/reference/java/lang/VMClassLoader.java,v
retrieving revision 1.16
diff -u -r1.16 VMClassLoader.java
--- vm/reference/java/lang/VMClassLoader.java 29 Mar 2003 22:05:56 -0000 1.16
+++ vm/reference/java/lang/VMClassLoader.java 12 Aug 2004 17:39:12 -0000
@@ -1,6 +1,6 @@
 /* VMClassLoader.java -- Reference implementation of native interface
    required by ClassLoader
-   Copyright (C) 1998, 2001, 2002 Free Software Foundation
+   Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -87,6 +87,12 @@
    * domain; that is the wrong behavior, and you should directly implement
    * this method natively if you can.</strong>
    *
+   * Implementations of this method are advised to consider the
+   * situation where user code modifies the byte array after it has
+   * been passed to defineClass.  This can be handled by making a
+   * private copy of the array, or arranging to only read any given
+   * byte a single time.
+   *
    * @param name the name to give the class, or null if unknown
    * @param data the data representing the classfile, in classfile format
    * @param offset the offset into the data where the classfile starts




reply via email to

[Prev in Thread] Current Thread [Next in Thread]