Re: [PATCH 2/3] wifi: ath12k: Reserve space for a string terminator

From: Dan Carpenter

Date: Sat Sep 26 2026 - 08:34:48 EST


On Sat, Sep 26, 2026 at 08:12:49PM +0800, Jiale Yao wrote:
> ath12k_write_htt_stats_type() accepts count == size, which fills the
> zero-initialized buffer without a terminating NUL. sscanf() then reads
> beyond the buffer.
>
> Reject input that leaves no room for the trailing NUL.
>
> Fixes: 8c7a5031a6b0 ("wifi: ath12k: Fix buffer overflow in debugfs")
> Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
> ---

Reviewed-by: Dan Carpenter <error27@xxxxxxxxx>

regards,
dan carpenter