OSDN Git Service

misc: st_kim: Increase size of dev_name buffer to incorporate termination
authorLee Jones <lee.jones@linaro.org>
Thu, 28 Aug 2014 13:14:09 +0000 (14:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 06:14:28 +0000 (23:14 -0700)
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.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/ti_wilink_st.h

index 932b763..884d626 100644 (file)
@@ -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;
 };