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

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

 



  The fields must be null-terminated,
  or next strcpy in dbll_find_dsp_symbol, will cause issue

additoinal info:
  dbll_find_dsp_symbol call find_symbol_callback to get name.
  and then call strcpy to copy the name to upper caller.

Signed-off-by: Chen Gang <gang.chen@xxxxxxxxxxx>
---
 drivers/staging/tidspbridge/pmgr/dbll.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/tidspbridge/pmgr/dbll.c b/drivers/staging/tidspbridge/pmgr/dbll.c
index 9f07036..c191ae2 100644
--- a/drivers/staging/tidspbridge/pmgr/dbll.c
+++ b/drivers/staging/tidspbridge/pmgr/dbll.c
@@ -1382,7 +1382,7 @@ void find_symbol_callback(void *elem, void *user_data)
 		offset < context->cur_best_offset) {
 		context->cur_best_offset = offset;
 		context->sym_addr = symbol_addr;
-		strncpy(context->name, symbol->name, sizeof(context->name));
+		strlcpy(context->name, symbol->name, sizeof(context->name));
 	}
 
 	return;
-- 
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