mod_insmod: fix coverity warning

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
zhuyanlin 2022-03-31 18:30:17 +08:00 committed by Xiang Xiao
parent c46a926e2b
commit 26ab4e9200

View File

@ -198,9 +198,11 @@ FAR void *insmod(FAR const char *filename, FAR const char *modname)
goto errout_with_loadinfo;
}
#ifdef HAVE_MODLIB_NAMES
/* Save the module name in the registry entry */
strlcpy(modp->modname, modname, MODLIB_NAMEMAX);
strlcpy(modp->modname, modname, sizeof(modp->modname));
#endif
/* Load the program binary */