]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3540. [bug] libt_api: t_info and t_assert were not thread safe.
authorMark Andrews <marka@isc.org>
Wed, 3 Apr 2013 06:17:02 +0000 (17:17 +1100)
committerMark Andrews <marka@isc.org>
Wed, 3 Apr 2013 06:19:20 +0000 (17:19 +1100)
CHANGES
lib/tests/t_api.c

diff --git a/CHANGES b/CHANGES
index a0ae2b2bef1938e742ae935a24fbaab52197920e..92f0ea21847248a109b80c7736e04aec522a7f5b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3540.  [bug]           libt_api: t_info and t_assert were not thread safe.
+
        --- 9.6-ESV-R9rc1 released ---
 
 3539.  [port]          win32: timestamp format didn't match other platforms.
index c96fed5772f85b91987a4a053e329d99a85b9fe7..bd745bfc656ec7f84e79440f692df5e518cfff86 100644 (file)
@@ -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