From: Chen Gang Date: Mon, 21 Jan 2013 09:36:33 +0000 (+0800) Subject: staging: tidspbridge/pmgr: another using strlcpy instead of strncpy X-Git-Tag: upstream/snapshot3+hdmi~5696^2~355 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b90d01425468cac50275ce2bd3b35218b56282d;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Cc: Omar Ramirez Luna Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/tidspbridge/pmgr/cod.c b/drivers/staging/tidspbridge/pmgr/cod.c index 4007826..6c29379 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;