svn commit: trunk/uClibc/test/unistd

vapier at uclibc.org vapier at uclibc.org
Sat Feb 4 02:48:50 UTC 2006


Author: vapier
Date: 2006-02-03 18:48:47 -0800 (Fri, 03 Feb 2006)
New Revision: 13828

Log:
fix segfault do to sizeof(NULL) usage

Modified:
   trunk/uClibc/test/unistd/clone_cruft.h


Changeset:
Modified: trunk/uClibc/test/unistd/clone_cruft.h
===================================================================
--- trunk/uClibc/test/unistd/clone_cruft.h	2006-02-04 02:20:46 UTC (rev 13827)
+++ trunk/uClibc/test/unistd/clone_cruft.h	2006-02-04 02:48:47 UTC (rev 13828)
@@ -2,10 +2,12 @@
 
 #undef do_clone
 
+#define crappy_sizeof(s) (s == NULL ? 0 : sizeof(s))
+
 #if defined __ia64__
 
 # define do_clone(fn, stack, flags, arg) \
-	__clone2(fn, stack, sizeof(stack), flags, arg, NULL, NULL, NULL)
+	__clone2(fn, stack, crappy_sizeof(stack), flags, arg, NULL, NULL, NULL)
 
 #elif defined __hppa__
 
@@ -15,6 +17,6 @@
 #else
 
 # define do_clone(fn, stack, flags, arg) \
-	clone(fn, stack+sizeof(stack), flags, arg)
+	clone(fn, stack+crappy_sizeof(stack), flags, arg)
 
 #endif




More information about the uClibc-cvs mailing list