summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-04 02:48:47 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-04 02:48:47 +0000
commitcb1941ccfc7193d0534fce862ff49e16c194d74f (patch)
treedb25b0d76493e32917dd2b3f1bdf6cfa6ffd4b72 /test
parent71b20283a6d41a08855cfb34b373e49091b6959a (diff)
fix segfault do to sizeof(NULL) usage
Diffstat (limited to 'test')
-rw-r--r--test/unistd/clone_cruft.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unistd/clone_cruft.h b/test/unistd/clone_cruft.h
index dacc1b2bf..2c04ca6f3 100644
--- a/test/unistd/clone_cruft.h
+++ b/test/unistd/clone_cruft.h
@@ -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