From 21a4f5cc867b4f166704df84985edc048caa2578 Mon Sep 17 00:00:00 2001 From: Tony Hutter Date: Wed, 4 Apr 2018 10:16:47 -0700 Subject: Fedora 28: Fix misc bounds check compiler warnings Fix a bunch of (mostly) sprintf/snprintf truncation compiler warnings that show up on Fedora 28 (GCC 8.0.1). Reviewed-by: Brian Behlendorf Signed-off-by: Tony Hutter Closes #7361 Closes #7368 --- lib/libspl/include/umem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libspl/include') diff --git a/lib/libspl/include/umem.h b/lib/libspl/include/umem.h index c63026cee..5b10ac801 100644 --- a/lib/libspl/include/umem.h +++ b/lib/libspl/include/umem.h @@ -146,7 +146,7 @@ umem_cache_create( cp = umem_alloc(sizeof (umem_cache_t), UMEM_DEFAULT); if (cp) { - strncpy(cp->cache_name, name, UMEM_CACHE_NAMELEN); + strlcpy(cp->cache_name, name, UMEM_CACHE_NAMELEN); cp->cache_bufsize = bufsize; cp->cache_align = align; cp->cache_constructor = constructor; -- cgit v1.2.3