aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_impl.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2019-12-30 14:18:35 -0800
committerGarrett D'Amore <garrett@damore.org>2019-12-30 14:39:50 -0800
commit8e3bebc736c224db4d7fc81ab9fa841c7015318a (patch)
tree0efb68886652936a6fa79fb290268a683cd3564f /src/platform/posix/posix_impl.h
parent3890f856068542c6ddb7b498a2e313b026450bd2 (diff)
downloadnng-8e3bebc736c224db4d7fc81ab9fa841c7015318a.tar.gz
nng-8e3bebc736c224db4d7fc81ab9fa841c7015318a.tar.bz2
nng-8e3bebc736c224db4d7fc81ab9fa841c7015318a.zip
fixes #1075 WebSocket heap use after free
This also introduces a new atomic boolean type, so we can use that to trigger whether we've added the HTTP handler or not.
Diffstat (limited to 'src/platform/posix/posix_impl.h')
-rw-r--r--src/platform/posix/posix_impl.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/platform/posix/posix_impl.h b/src/platform/posix/posix_impl.h
index b07d268b..a1cb62c5 100644
--- a/src/platform/posix/posix_impl.h
+++ b/src/platform/posix/posix_impl.h
@@ -1,5 +1,5 @@
//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -84,7 +84,11 @@ struct nni_atomic_flag {
};
struct nni_atomic_u64 {
- _Atomic unsigned long long v;
+ atomic_uint_fast64_t v;
+};
+
+struct nni_atomic_bool {
+ atomic_bool v;
};
#else // NNG_HAVE_C11_ATOMIC
@@ -92,6 +96,10 @@ struct nni_atomic_flag {
bool f;
};
+struct nni_atomic_bol {
+ bool b;
+};
+
struct nni_atomic_u64 {
uint64_t v;
};