--- hurd/libpthread/pthread/pt-setcancelstate.c	2002-10-10 23:05:06.000000000 +0000
+++ hurd/libpthread/pthread/pt-setcancelstate.c	2006-10-23 19:59:55.000000000 +0000
@@ -35,7 +35,8 @@
       break;
     }
 
-  *oldstate = p->cancel_state;
+  if (oldstate)
+    *oldstate = p->cancel_state;
   p->cancel_state = state;
 
   return 0;
