Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEEPIN: MIPS: loongson64: use strlen to calculate string length
Suppress a Clang warning regarding potential buffer overflow: arch/mips/loongson64/env.c:190:31: error: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Werror,-Wstrncat-size] 190 | strncat(cpu_full_name, freq, sizeof(cpu_full_name)); | ^~~~~~~~~~~~~~~~~~~~~ arch/mips/loongson64/env.c:190:31: note: change the argument to be the free space in the destination buffer minus the terminating null byte 190 | strncat(cpu_full_name, freq, sizeof(cpu_full_name)); | ^~~~~~~~~~~~~~~~~~~~~ | sizeof(cpu_full_name) - strlen(cpu_full_name) - 1 1 error generated. Fixes: "BACKPORT: FROMLIST: MIPS: Add __cpu_full_name[] to make CPU names more human-readable" Signed-off-by: Mingcong Bai <[email protected]>
- Loading branch information