]> granicus.if.org Git - zfs/commitdiff
Fix coverity defects: CID 150919, 150923
authorluozhengzheng <luo.zhengzheng@zte.com.cn>
Thu, 20 Oct 2016 18:09:39 +0000 (02:09 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 20 Oct 2016 18:09:39 +0000 (11:09 -0700)
CID 150919: Buffer not null terminated (BUFFER_SIZE_WARNING)
CID 150923: Buffer not null terminated (BUFFER_SIZE_WARNING)

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn>
Closes #5298

module/icp/os/modconf.c
module/icp/spi/kcf_spi.c

index e0cd7f4ad8760b1e10fd6eaa68d5569800f0519d..32b46b5ff7b13669186aa1749c0ad1bb55a9d6ab 100644 (file)
@@ -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)
index e6e463a6284817255ce8d8992a588381d669281e..8bd86b0a385e0784ec14de340431e48534837fb4 100644 (file)
@@ -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);