Skip to content

Commit

Permalink
staging: tidspbridge/pmgr: another using strlcpy instead of strncpy
Browse files Browse the repository at this point in the history
  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: Chen Gang <gang.chen@asianux.com>
Cc: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chen Gang authored and Greg Kroah-Hartman committed Jan 21, 2013
1 parent 9814a87 commit 4b90d01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/tidspbridge/pmgr/cod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4b90d01

Please sign in to comment.