Home
last modified time | relevance | path

Searched hist:"3690 c8c9" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/net/ethernet/qlogic/qed/
H A Dqed_int.c3690c8c9 Wed Jul 31 03:15:42 CDT 2019 Wang Xiayang <xywang.sjtu@sjtu.edu.cn> net/ethernet/qlogic/qed: force the string buffer NULL-terminated

strncpy() does not ensure NULL-termination when the input string
size equals to the destination buffer size 30.
The output string is passed to qed_int_deassertion_aeu_bit()
which calls DP_INFO() and relies NULL-termination.

Use strlcpy instead. The other conditional branch above strncpy()
needs no fix as snprintf() ensures NULL-termination.

This issue is identified by a Coccinelle script.

Signed-off-by: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
3690c8c9 Wed Jul 31 03:15:42 CDT 2019 Wang Xiayang <xywang.sjtu@sjtu.edu.cn> net/ethernet/qlogic/qed: force the string buffer NULL-terminated

strncpy() does not ensure NULL-termination when the input string
size equals to the destination buffer size 30.
The output string is passed to qed_int_deassertion_aeu_bit()
which calls DP_INFO() and relies NULL-termination.

Use strlcpy instead. The other conditional branch above strncpy()
needs no fix as snprintf() ensures NULL-termination.

This issue is identified by a Coccinelle script.

Signed-off-by: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>