summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorluozhengzheng <[email protected]>2016-10-21 02:09:39 +0800
committerBrian Behlendorf <[email protected]>2016-10-20 11:09:39 -0700
commit1f72394443f710a0be11232b557b8a698693668d (patch)
tree9eaa824aafba089393aa01b48738e9a61086f421 /module
parent381823d6d2f1b3bcd0ef6a4f391396e5d9406036 (diff)
Fix coverity defects: CID 150919, 150923
CID 150919: Buffer not null terminated (BUFFER_SIZE_WARNING) CID 150923: Buffer not null terminated (BUFFER_SIZE_WARNING) Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tom Caputi <[email protected]> Signed-off-by: luozhengzheng <[email protected]> Closes #5298
Diffstat (limited to 'module')
-rw-r--r--module/icp/os/modconf.c2
-rw-r--r--module/icp/spi/kcf_spi.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/module/icp/os/modconf.c b/module/icp/os/modconf.c
index e0cd7f4ad..32b46b5ff 100644
--- a/module/icp/os/modconf.c
+++ b/module/icp/os/modconf.c
@@ -146,7 +146,7 @@ mod_info(struct modlinkage *modlp, struct modinfo *modinfop)
if (*linkpp == NULL) {
msip->msi_linkinfo[0] = '\0';
} else {
- (void) strncpy(msip->msi_linkinfo,
+ (void) strlcpy(msip->msi_linkinfo,
(*linkpp)->misc_linkinfo, MODMAXLINKINFOLEN);
retval = MODL_INFO(*linkpp, modlp, &msip->msi_p0);
if (retval != 0)
diff --git a/module/icp/spi/kcf_spi.c b/module/icp/spi/kcf_spi.c
index e6e463a62..8bd86b0a3 100644
--- a/module/icp/spi/kcf_spi.c
+++ b/module/icp/spi/kcf_spi.c
@@ -889,7 +889,7 @@ kcf_do_notify(kcf_provider_desc_t *prov_desc, boolean_t is_added)
ec.ec_change = is_added ? CRYPTO_MECH_ADDED :
CRYPTO_MECH_REMOVED;
for (i = 0; i < prov_desc->pd_mech_list_count; i++) {
- (void) strncpy(ec.ec_mech_name,
+ (void) strlcpy(ec.ec_mech_name,
prov_desc->pd_mechanisms[i].cm_mech_name,
CRYPTO_MAX_MECH_NAME);
kcf_walk_ntfylist(CRYPTO_EVENT_MECHS_CHANGED, &ec);