From fc66af5eea10a7da9061ab7225d79ee63b5122f3 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Wed, 24 Feb 2016 14:52:28 +0000 Subject: [PATCH] - Fix OpenBSD asynclook lock free that gets used later (fix test code). git-svn-id: file:///svn/unbound/trunk@3638 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 3 +++ testcode/asynclook.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index b7153f6df..79931efe9 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +24 February 2016: Wouter + - Fix OpenBSD asynclook lock free that gets used later (fix test code). + 23 February 2016: Wouter - ub_ctx_set_stub() function for libunbound to config stub zones. - sorted ubsyms.def file with exported libunbound functions. diff --git a/testcode/asynclook.c b/testcode/asynclook.c index 534489735..43e1dccf5 100644 --- a/testcode/asynclook.c +++ b/testcode/asynclook.c @@ -335,12 +335,17 @@ ext_thread(void* arg) r = ub_wait(inf->ctx); checkerr("ub_ctx_wait", r); } + /* if these locks are destroyed, or if the async_ids is freed, then + a use-after-free happens in another thread. + The allocation is only part of this test, though. */ + /* if(async_ids) { for(i=0; inumq; i++) { lock_basic_destroy(&async_ids[i].lock); } } free(async_ids); + */ return NULL; } -- 2.47.2