提交 4b90d014 编写于 作者: C Chen Gang 提交者: Greg Kroah-Hartman

staging: tidspbridge/pmgr: another using strlcpy instead of strncpy

  The fields must be null-terminated,
  or next strstr in dcd_get_objects, will cause issue

additoinal info:
  nldr_create may call cod_get_base_name, let sz_zl_file to get name (sz_name)
  and then call dcd_get_objects, passing sz_zl_file as a name string.
Signed-off-by: NChen Gang <gang.chen@asianux.com>
Cc: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9814a875
......@@ -289,7 +289,7 @@ int cod_get_base_name(struct cod_manager *cod_mgr_obj, char *sz_name,
int status = 0;
if (usize <= COD_MAXPATHLENGTH)
strncpy(sz_name, cod_mgr_obj->sz_zl_file, usize);
strlcpy(sz_name, cod_mgr_obj->sz_zl_file, usize);
else
status = -EPERM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册