Thread (2 messages) 2 messages, 2 authors, 2019-08-03

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

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help