]> 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:18:13 +0000 (17:18 +1100)
CHANGES
lib/tests/t_api.c

diff --git a/CHANGES b/CHANGES
index 07fa8dc8fe7202b99fca9a882b8ef79841e41954..93b977f8e496e17e65ae1d4a1413034c249f59a7 100644 (file)
--- 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.
 
        --- 9.9.3rc1 released ---
index 49605365feaea996b47bdb7faeb496ed3dcbc2b2..80c9f15cc6ec81879223af851e76bd29e87c8439 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