mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
dm: hw: Replace strlen with strnlen
Replace strlen function with strnlen function in device-model Tracked-On: #2079 Signed-off-by: Long Liu <long.liu@intel.com> Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com> Reviewed-by: <yonghua.huang@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
@@ -1006,7 +1006,7 @@ basl_make_templates(void)
|
||||
tmpdir = _PATH_TMP;
|
||||
}
|
||||
|
||||
len = strlen(tmpdir);
|
||||
len = strnlen(tmpdir, MAXPATHLEN);
|
||||
|
||||
if ((len + sizeof(ASL_TEMPLATE) + 1) < MAXPATHLEN) {
|
||||
strncpy(basl_template, tmpdir, len + 1);
|
||||
|
||||
Reference in New Issue
Block a user