From: Mark Andrews Date: Wed, 3 Apr 2013 06:17:02 +0000 (+1100) Subject: 3540. [bug] libt_api: t_info and t_assert were not thread safe. X-Git-Tag: v9.10.0a1~448^2~5 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=8c460e01594e83f21ff5e60cd7a417a1ed618703;p=thirdparty%2Fbind9.git 3540. [bug] libt_api: t_info and t_assert were not thread safe. --- diff --git a/CHANGES b/CHANGES index 85fec43eb61..4cd71256422 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3540. [bug] libt_api: t_info and t_assert were not thread safe. + 3539. [port] win32: timestamp format didn't match other platforms. 3538. [test] Running "make test" now requires loopback interfaces diff --git a/lib/tests/t_api.c b/lib/tests/t_api.c index 49605365fea..80c9f15cc6e 100644 --- a/lib/tests/t_api.c +++ b/lib/tests/t_api.c @@ -343,6 +343,7 @@ main(int argc, char **argv) { void t_assert(const char *component, int anum, int class, const char *what, ...) { va_list args; + char buf[T_BIGBUF]; (void)printf("T:%s:%d:%s\n", component, anum, class == T_REQUIRED ? "A" : "C"); @@ -351,21 +352,22 @@ t_assert(const char *component, int anum, int class, const char *what, ...) { * Format text to a buffer. */ va_start(args, what); - (void)vsnprintf(T_buf, sizeof(T_buf), what, args); + (void)vsnprintf(buf, sizeof(buf), what, args); va_end(args); - (void)t_putinfo("A", T_buf); + (void)t_putinfo("A", buf); (void)printf("\n"); } void t_info(const char *format, ...) { va_list args; + char buf[T_BIGBUF]; va_start(args, format); - (void) vsnprintf(T_buf, sizeof(T_buf), format, args); + (void) vsnprintf(buf, sizeof(buf), format, args); va_end(args); - (void) t_putinfo("I", T_buf); + (void) t_putinfo("I", buf); } void