Re: [PATCH next 4/8] test_hexdump: Check for buffer overrun of sample output buffer

Andy Shevchenko
2025-03-10T09:01:36Z

On Sat, Mar 08, 2025 at 09:34:48AM +0000, David Laight wrote:
> While the output generated by test_hexdump_prepare_test() shouldn't
> be longer than the size of the buffer passed, for safety verify that
> the buffer is long enough.
> If too short fill the buffer with an error message - output on
> test failure.

Isn't the function should behave snprintf() alike?
I think this patch is simply wrong because it's based on a wrong assumption.

--
With Best Regards,
Andy Shevchenko