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

2019-08-02 Thread David Miller
From: Wang Xiayang 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

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

2019-07-31 Thread Wang Xiayang
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