diff options
author | Roland McGrath <roland@hack.frob.com> | 2013-04-19 13:49:07 -0700 |
---|---|---|
committer | Roland McGrath <roland@hack.frob.com> | 2013-04-19 14:57:25 -0700 |
commit | 0d3158a3c122d48d65c4bd62c5ae8dc52b900422 (patch) | |
tree | 7e896c581aa105e47aa0dcb4eb8e80f1c43dd422 /nptl/pthread_attr_getstack.c | |
parent | 7214d558d3a63e9c7b638787953ab1fe80c4adc1 (diff) | |
download | glibc-roland/pthread_attr_getstack.tar.gz |
Make pthread_attr_getstack fail with EINVAL when called in "unspecified behavior" situation wherein the stackaddr was never set.roland/pthread_attr_getstack
Diffstat (limited to 'nptl/pthread_attr_getstack.c')
-rw-r--r-- | nptl/pthread_attr_getstack.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nptl/pthread_attr_getstack.c b/nptl/pthread_attr_getstack.c index 03907b7242..696d8c07f6 100644 --- a/nptl/pthread_attr_getstack.c +++ b/nptl/pthread_attr_getstack.c @@ -31,6 +31,9 @@ __pthread_attr_getstack (attr, stackaddr, stacksize) assert (sizeof (*attr) >= sizeof (struct pthread_attr)); iattr = (struct pthread_attr *) attr; + if (!(iattr->flags & ATTR_FLAG_STACKADDR)) + return EINVAL; + /* Store the result. */ *stackaddr = (char *) iattr->stackaddr - iattr->stacksize; *stacksize = iattr->stacksize; |