diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2009-08-23 19:47:05 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2009-08-23 19:47:05 +0200 |
commit | b4547d9244cb9221bcaaa8f583c566bab5638784 (patch) | |
tree | d7af1749af5f834e761440c219e24b571f8db201 /pthread/pt-setcanceltype.c | |
parent | 4776fb251ce840be1099ffc481116d8a3ee8916a (diff) |
Fix pthread_setcancelstate/type crash
* pthread/pt-setcancelstate.c (pthread_setcancelstate): Check whether
OLDSTATE is NULL before filling it.
* pthread/pt-setcanceltype.c (pthread_setcanceltype): Likewise.
Diffstat (limited to 'pthread/pt-setcanceltype.c')
-rw-r--r-- | pthread/pt-setcanceltype.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pthread/pt-setcanceltype.c b/pthread/pt-setcanceltype.c index 9511c99..3ce4259 100644 --- a/pthread/pt-setcanceltype.c +++ b/pthread/pt-setcanceltype.c @@ -35,7 +35,8 @@ pthread_setcanceltype (int type, int *oldtype) break; } - *oldtype = p->cancel_type; + if (oldtype) + *oldtype = p->cancel_type; p->cancel_type = type; return 0; |