Re: [PATCH] net/ethernet/qlogic/qed: force the string buffer NULL-terminated

From
David Miller <davem@davemloft.net>
Date
2019-08-03 00:57:35
Reply to
Wang Xiayang, 2019-07-31
From: Wang Xiayang <redacted>
Date: Wed, 31 Jul 2019 16:15:42 +0800
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 <redacted>
Applied.
Thread (2 messages) 2 messages, 2 authors, last reply 2019-08-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help