Thread (12 messages) 12 messages, 2 authors, 2014-08-30
STALE4309d

[PATCH 03/11] misc: st_kim: Increase size of dev_name buffer to incorporate termination

From: Lee Jones <hidden>
Date: 2014-08-28 13:16:53
Also in: lkml
Subsystem: the rest · Maintainer: Linus Torvalds

Calling strncpy with a maximum size argument of 32 bytes on destination
array kim_gdata->dev_name of size 32 bytes might leave the destination
string unterminated.

Cc: gregkh at linuxfoundation.org
Signed-off-by: Lee Jones <redacted>
---
 include/linux/ti_wilink_st.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index 932b7639..884d626 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -268,7 +268,7 @@ struct kim_data_s {
 	struct st_data_s *core_data;
 	struct chip_version version;
 	unsigned char ldisc_install;
-	unsigned char dev_name[UART_DEV_NAME_LEN];
+	unsigned char dev_name[UART_DEV_NAME_LEN + 1];
 	unsigned char flow_cntrl;
 	unsigned long baud_rate;
 };
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help