Merge pull request #94 from nil0x42/patch-1
Use safe snprintf() instead of sprintf()
This commit is contained in:
commit
66fae216b7
4
thpool.c
4
thpool.c
|
@ -317,8 +317,8 @@ static void thread_hold(int sig_id) {
|
|||
static void* thread_do(struct thread* thread_p){
|
||||
|
||||
/* Set thread name for profiling and debuging */
|
||||
char thread_name[128] = {0};
|
||||
sprintf(thread_name, "thread-pool-%d", thread_p->id);
|
||||
char thread_name[32] = {0};
|
||||
snprintf(thread_name, 32, "thread-pool-%d", thread_p->id);
|
||||
|
||||
#if defined(__linux__)
|
||||
/* Use prctl instead to prevent using _GNU_SOURCE flag and implicit declaration */
|
||||
|
|
Loading…
Reference in New Issue