Commit 6707ba0
ath10k: avoid possible string overflow
The way that 'strncat' is used here raised a warning in gcc-8:
drivers/net/wireless/ath/ath10k/wmi.c: In function 'ath10k_wmi_tpc_stats_final_disp_tables':
drivers/net/wireless/ath/ath10k/wmi.c:4649:4: error: 'strncat' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
Effectively, this is simply a strcat() but the use of strncat() suggests
some form of overflow check. Regardless of whether this might actually
overflow, using strlcat() instead of strncat() avoids the warning and
makes the code more robust.
Fixes: bc64d05 ("ath10k: debugfs support to get final TPC stats for 10.4 variants")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>1 parent a72c926 commit 6707ba0
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4357 | 4357 | | |
4358 | 4358 | | |
4359 | 4359 | | |
4360 | | - | |
| 4360 | + | |
4361 | 4361 | | |
4362 | 4362 | | |
4363 | 4363 | | |
| |||
4694 | 4694 | | |
4695 | 4695 | | |
4696 | 4696 | | |
4697 | | - | |
| 4697 | + | |
4698 | 4698 | | |
4699 | 4699 | | |
4700 | 4700 | | |
| |||
0 commit comments