From 8e3bebc736c224db4d7fc81ab9fa841c7015318a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 30 Dec 2019 14:18:35 -0800 Subject: 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. --- src/platform/posix/posix_impl.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/platform/posix/posix_impl.h') 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. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // 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; }; -- cgit v1.2.3-70-g09d2