com_err: make error_table_name() thread-safe
authorNicolas Williams <nico@twosigma.com>
Tue, 3 Mar 2020 21:28:54 +0000 (15:28 -0600)
committerNicolas Williams <nico@twosigma.com>
Fri, 24 Apr 2020 05:11:56 +0000 (00:11 -0500)
lib/com_err/com_err.c

index 22a810f8f2a6d3875728d178ecae069af99af1ad..52f6e2e43d4f3994f529843fbcef6642375c0691 100644 (file)
@@ -38,6 +38,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <roken.h>
+#include <heim_threads.h>
 #include "com_err.h"
 
 struct et_list *_et_list = NULL;
@@ -132,7 +133,7 @@ reset_com_err_hook (void)
 static const char char_set[] =
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
 
-static char buf[6];
+static HEIMDAL_THREAD_LOCAL char buf[6];
 
 KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL
 error_table_name(int num)