From: Wouter Wijngaards Date: Fri, 21 Nov 2014 08:22:18 +0000 (+0000) Subject: - Fix crash on multiple thread random usage on systems without X-Git-Tag: release-1.5.1rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58542119a2b6888dcdcd438977815a08cb81a792;p=thirdparty%2Funbound.git - Fix crash on multiple thread random usage on systems without arc4random. git-svn-id: file:///svn/unbound/trunk@3277 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/compat/arc4_lock.c b/compat/arc4_lock.c index ce8bb4168..faa743d15 100644 --- a/compat/arc4_lock.c +++ b/compat/arc4_lock.c @@ -53,8 +53,10 @@ static int arc4lockinit = 0; void _ARC4_LOCK(void) { - if(!arc4lockinit) + if(!arc4lockinit) { + arc4lockinit = 1; lock_quick_init(&arc4lock); + } lock_quick_lock(&arc4lock); } diff --git a/doc/Changelog b/doc/Changelog index 4fdb89813..983c6d217 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +21 November 2014: Wouter + - Fix crash on multiple thread random usage on systems without + arc4random. + 20 November 2014: Wouter - fix compat/getentropy_win.c check if CryptGenRandom works and no immediate exit on windows.