diff options
author | Chen Gang | 2013-01-21 10:36:33 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-01-21 23:00:10 +0100 |
commit | 4b90d01425468cac50275ce2bd3b35218b56282d (patch) | |
tree | 038942877eeb520adc75e251f8e14a73dc7d18b6 | |
parent | staging: tidspbridge/pmgr: use strlcpy instead of strncpy (diff) | |
download | kernel-qcow2-linux-4b90d01425468cac50275ce2bd3b35218b56282d.tar.gz kernel-qcow2-linux-4b90d01425468cac50275ce2bd3b35218b56282d.tar.xz kernel-qcow2-linux-4b90d01425468cac50275ce2bd3b35218b56282d.zip |
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: Chen Gang <gang.chen@asianux.com>
Cc: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/tidspbridge/pmgr/cod.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/tidspbridge/pmgr/cod.c b/drivers/staging/tidspbridge/pmgr/cod.c index 4007826f7abc..6c29379baf60 100644 --- a/drivers/staging/tidspbridge/pmgr/cod.c +++ b/drivers/staging/tidspbridge/pmgr/cod.c @@ -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; |