Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-06-23 23:05:15 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-06-23 23:05:15 +0400
commit8431e478d2f74ebf0bcfd2bc4c71e3c391fc7753 (patch)
treed3de9519039b3fb0e2536eabbabd2445015e902b /winsup/cygwin/thread.cc
parentcf06a0b18cf8dd93531f73e2a31f0c72389e84ec (diff)
* spawn.cc (find_exec): Initialize err (CID 60111).
* strace.cc (strace::activate): Fix potential buffer overrun (CID 59938) * syscalls.cc (popen): Close parent pipe descriptor via fclosing fp on error to avoid resource leak (CID 59981). * thread.cc (pthread::exit): Avoid accessing cygtls member after deleting "this" (CID 60217).
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r--winsup/cygwin/thread.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 8cec7fba2..e411301cb 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -511,6 +511,7 @@ void
pthread::exit (void *value_ptr)
{
class pthread *thread = this;
+ bool is_main_tls = (cygtls == _main_tls); // Check cygtls before deleting this
// run cleanup handlers
pop_all_cleanup_handlers ();
@@ -536,7 +537,7 @@ pthread::exit (void *value_ptr)
::exit (0);
else
{
- if (cygtls == _main_tls)
+ if (is_main_tls)
{
_cygtls *dummy = (_cygtls *) malloc (sizeof (_cygtls));
*dummy = *_main_tls;