Re: [PATCH] Remove hardcoded static string length

From: Kenny Ho
Date: Thu May 25 2023 - 10:28:09 EST

On Thu, May 25, 2023 at 5:14 AM David Laight <David.Laight@xxxxxxxxxx> wrote:
> I does rather beg the question as what is in UTS_RELEASE when
> it exceeds (IIRC) about 48 characters?

Thanks for the question as it made me dig deeper. UTS_RELEASE is
actually capped at 64:
uts_len := 64
define filechk_utsrelease.h
if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \

So UTS_RELEASE on its own would fit perfectly by coincidence (and it
is also why UTS_RELEASE with the pre and postfix exceeds the limit.)
That makes me wonder if the content / format of the version matter and
looks like it sort of does by looking at when the string was

"The standard formulation seems to be: <project> <version> built

That commit also confirms the size and null termination requirement.

I will create a separate patch with your suggestion.