aboutsummaryrefslogtreecommitdiffstats
path: root/module/icp
diff options
context:
space:
mode:
authorJoao Carlos Mendes Luis <[email protected]>2018-08-26 16:55:44 -0300
committerBrian Behlendorf <[email protected]>2018-08-26 12:55:44 -0700
commit5d6ad2442b0ac97922403edda848697c9e9de399 (patch)
treef178a893026cbd88c3a6ad5519da8521a2304935 /module/icp
parent644e01a268ad55dc789a79982d62d3db59660499 (diff)
Fedora 28: Fix misc bounds check compiler warnings
Fix a bunch of truncation compiler warnings that show up on Fedora 28 (GCC 8.0.1). Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Issue #7368 Closes #7826 Closes #7830
Diffstat (limited to 'module/icp')
-rw-r--r--module/icp/core/kcf_mech_tabs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/icp/core/kcf_mech_tabs.c b/module/icp/core/kcf_mech_tabs.c
index 723bfdb60..741dae7a7 100644
--- a/module/icp/core/kcf_mech_tabs.c
+++ b/module/icp/core/kcf_mech_tabs.c
@@ -321,7 +321,7 @@ kcf_create_mech_entry(kcf_ops_class_t class, char *mechname)
mutex_enter(&(me_tab[i].me_mutex));
if (me_tab[i].me_name[0] == 0) {
/* Found an empty spot */
- (void) strncpy(me_tab[i].me_name, mechname,
+ (void) strlcpy(me_tab[i].me_name, mechname,
CRYPTO_MAX_MECH_NAME);
me_tab[i].me_name[CRYPTO_MAX_MECH_NAME-1] = '\0';
me_tab[i].me_mechid = KCF_MECHID(class, i);