This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch roland/pthread_attr_getstack created. glibc-2.17-545-g0d3158a


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, roland/pthread_attr_getstack has been created
        at  0d3158a3c122d48d65c4bd62c5ae8dc52b900422 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0d3158a3c122d48d65c4bd62c5ae8dc52b900422

commit 0d3158a3c122d48d65c4bd62c5ae8dc52b900422
Author: Roland McGrath <roland@hack.frob.com>
Date:   Fri Apr 19 13:49:07 2013 -0700

    Make pthread_attr_getstack fail with EINVAL when called in "unspecified behavior" situation wherein the stackaddr was never set.

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index d2a1e47..85f0c40 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-19  Roland McGrath  <roland@hack.frob.com>
+
+	* pthread_attr_getstack.c: Fail with EINVAL if the stack address has
+	not been set.
+
 2013-04-11  Andreas Schwab  <schwab@suse.de>
 
 	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
diff --git a/nptl/pthread_attr_getstack.c b/nptl/pthread_attr_getstack.c
index 03907b7..696d8c0 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;

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]