[kaffe] CVS kaffe (robilad): Fixed strdup crash

Kaffe CVS cvs-commits at kaffe.org
Thu Jul 7 19:09:40 PDT 2005


PatchSet 6715 
Date: 2005/07/08 02:04:42
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Fixed strdup crash

2005-07-08  Dalibor Topic  <robilad at kaffe.org>

        * kaffe/kaffe/main.c (main): Only use strdup if parameter is known
        not to be NULL. Brown paper bag time.

Members: 
	ChangeLog:1.4239->1.4240 
	kaffe/kaffe/main.c:1.87->1.88 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4239 kaffe/ChangeLog:1.4240
--- kaffe/ChangeLog:1.4239	Thu Jul  7 23:17:20 2005
+++ kaffe/ChangeLog	Fri Jul  8 02:04:42 2005
@@ -1,5 +1,10 @@
 2005-07-08  Dalibor Topic  <robilad at kaffe.org>
 
+	* kaffe/kaffe/main.c (main): Only use strdup if parameter is known
+	not to be NULL. Brown paper bag time.
+
+2005-07-08  Dalibor Topic  <robilad at kaffe.org>
+
 	Resynced with GNU classpath.
 
 	2005-07-07  Roman Kennke  <roman at kennke.org>
Index: kaffe/kaffe/kaffe/main.c
diff -u kaffe/kaffe/kaffe/main.c:1.87 kaffe/kaffe/kaffe/main.c:1.88
--- kaffe/kaffe/kaffe/main.c:1.87	Thu Jul  7 03:08:36 2005
+++ kaffe/kaffe/kaffe/main.c	Fri Jul  8 02:04:45 2005
@@ -130,7 +130,7 @@
 		}
 #endif
 	}
-	vmargs.classpath = strdup(cp);
+	vmargs.classpath = (cp == NULL? NULL :strdup(cp));
 
         cp = getenv(LIBRARYPATH1);
 	if (cp == 0) {




More information about the kaffe mailing list