From: W.C.A. Wijngaards Date: Wed, 4 Aug 2021 09:05:51 +0000 (+0200) Subject: - Fix missing locks in zonemd unit test. X-Git-Tag: release-1.13.2rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dd270d625b5e31697a4d0085d7d4db1f5e819f7;p=thirdparty%2Funbound.git - Fix missing locks in zonemd unit test. --- diff --git a/doc/Changelog b/doc/Changelog index ccd40966c..ac992b345 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -8,6 +8,7 @@ 4 August 2021: Wouter - In unit test use openssl set security level to allow keys in test. - Fix static analysis warnings about localzone locks that are unused. + - Fix missing locks in zonemd unit test. 3 August 2021: George - Listen to read or write events after the SSL handshake. diff --git a/testcode/unitzonemd.c b/testcode/unitzonemd.c index 3352a7c37..b5b865eab 100644 --- a/testcode/unitzonemd.c +++ b/testcode/unitzonemd.c @@ -82,7 +82,9 @@ static void zonemd_generate_test(const char* zname, char* zfile, /* read file */ z = authtest_addzone(az, zname, zfile); unit_assert(z); + lock_rw_wrlock(&z->lock); z->zonemd_check = 1; + lock_rw_unlock(&z->lock); /* create zonemd digest */ result = auth_zone_generate_zonemd_hash(z, scheme, hashalgo, @@ -197,7 +199,9 @@ static void zonemd_check_test(void) /* read file */ z = authtest_addzone(az, zname, zfile); unit_assert(z); + lock_rw_wrlock(&z->lock); z->zonemd_check = 1; + lock_rw_unlock(&z->lock); hashlen = sizeof(hash); if(sldns_str2wire_hex_buf(digest, hash, &hashlen) != 0) { unit_assert(0); /* parse failure */