Re: [PATCH v2] pinctrl: zynqmp: Ensure function names are NUL terminated
From: Peter Korsgaard
Date: Wed Nov 18 2026 - 11:49:38 EST
>>>>> "Sai" == Sai Krishna Potthuri <sai.krishna.potthuri@xxxxxxx> writes:
> PM_QID_PINCTRL_GET_FUNCTION_NAME returns the function name in a fixed
> 16-byte field and does not guarantee NUL termination. A 16-character
> name fills the entire field.
> The driver copies this field into a 16-byte buffer and subsequently
> uses it as a C string. For a non-NUL-terminated name, string operations
> can read past the end of the buffer into the adjacent groups pointer.
> Reserve an extra byte for the NUL terminator and explicitly terminate
> the copied function name.
> Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@xxxxxxx>
> ---
> changes in v2:
> - Replace macro/constants with sizeof()(comment from David Laight)
Reviewed-by: Peter Korsgaard <peter@xxxxxxxxxxxxx>
--
Bye, Peter Korsgaard