PR target/42811 (prerequisite)
authordavek <davek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 21 Mar 2010 19:36:49 +0000 (19:36 +0000)
committerdavek <davek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 21 Mar 2010 19:36:49 +0000 (19:36 +0000)
* jvmti.cc (_Jv_GetJVMTIEnv): Avoid use of uninitialised memory.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157605 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/jvmti.cc

index d803ad9..9e14331 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-21  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR target/42811 (prerequisite)
+       * jvmti.cc (_Jv_GetJVMTIEnv): Avoid use of uninitialised memory.
+
 2010-03-13  Matthias Klose  <doko@ubuntu.com>
 
        PR libgcj/42676
index d9bcc80..3ac6365 100644 (file)
@@ -2210,6 +2210,7 @@ _Jv_GetJVMTIEnv (void)
 {
   _Jv_JVMTIEnv *env
     = (_Jv_JVMTIEnv *) _Jv_MallocUnchecked (sizeof (_Jv_JVMTIEnv));
+  memset (env, 0, sizeof (_Jv_JVMTIEnv));
   env->p = &_Jv_JVMTI_Interface;
   struct jvmti_env_list *element
     = (struct jvmti_env_list *) _Jv_MallocUnchecked (sizeof (struct jvmti_env_list));