[PATCH] drivers/staging/tidspbridge/pmgr: another using strlcpy instead of strncpy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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@xxxxxxxxxxx>
---
 drivers/staging/tidspbridge/pmgr/cod.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 
-- 
1.7.10.4
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux