summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-01-31 15:32:38 +0100
committerGitHub <noreply@github.com>2019-01-31 15:32:38 +0100
commit41e8603bfab2db06ac0f29bd57e95508bfae6798 (patch)
tree333c36e40e2ae7f9649dab5a85956b963e0e99d1
parentMerge pull request #3699 from donaldsharp/zebra_rib_debugs (diff)
parentlib: snprintf to strlcpy in frr_pthread.c (diff)
downloadfrr-41e8603bfab2db06ac0f29bd57e95508bfae6798.tar.xz
frr-41e8603bfab2db06ac0f29bd57e95508bfae6798.zip
Merge pull request #3714 from donaldsharp/thread_strlcpy
lib: snprintf to strlcpy in frr_pthread.c
-rw-r--r--lib/frr_pthread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c
index fe18eb105..d7f655271 100644
--- a/lib/frr_pthread.c
+++ b/lib/frr_pthread.c
@@ -83,9 +83,9 @@ struct frr_pthread *frr_pthread_new(struct frr_pthread_attr *attr,
name = (name ? name : "Anonymous thread");
fpt->name = XSTRDUP(MTYPE_FRR_PTHREAD, name);
if (os_name)
- snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", os_name);
+ strlcpy(fpt->os_name, os_name, OS_THREAD_NAMELEN);
else
- snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", name);
+ strlcpy(fpt->os_name, name, OS_THREAD_NAMELEN);
/* initialize startup synchronization primitives */
fpt->running_cond_mtx = XCALLOC(
MTYPE_PTHREAD_PRIM, sizeof(pthread_mutex_t));