I've checked in the attached patch which fixes a core dump (in the
child process) when a zero length command array is passed.

2005-03-11  Archie Cobbs  <[EMAIL PROTECTED]>

       * native/jni/java-lang/java_lang_VMProcess.c: Fix segfault
       in the case that a zero length command array is passed.

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
Index: native/jni/java-lang/java_lang_VMProcess.c
===================================================================
RCS file: 
/cvsroot/classpath/classpath/native/jni/java-lang/java_lang_VMProcess.c,v
retrieving revision 1.3
diff -u -r1.3 java_lang_VMProcess.c
--- native/jni/java-lang/java_lang_VMProcess.c  21 Dec 2004 16:17:07 -0000      
1.3
+++ native/jni/java-lang/java_lang_VMProcess.c  12 Mar 2005 03:47:22 -0000
@@ -177,6 +177,8 @@
    * directory into a single array for simplicity of (de)allocation.
    */
   cmdArrayLen = (*env)->GetArrayLength(env, cmdArray);
+  if (cmdArrayLen == 0)
+    goto null_pointer_exception;
   if (envArray != NULL)
     envArrayLen = (*env)->GetArrayLength(env, envArray);
   if ((strings = malloc(((cmdArrayLen + 1)
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to