On Thu, Jun 1, 2023 at 3:28 PM Olaf Hering <o...@aepfle.de> wrote:

> Copy and use more constants from vmx.h, to turn numbers into strings.
> Adjust the REASON_MAX value accordingly.
> Remove the size constraint from string array, the compiler will grow it
> as needed.
>
> Signed-off-by: Olaf Hering <o...@aepfle.de>
>

Thanks for doing this.

Everything looks good (including adding the missing strings), except for
the removal of the fixed array size.  Call me paranoid, but if we define it
as REASON_MAX length, then there will never be any way that a value less
than REASON_MAX causes a segfault (and if we assign a value higher than
REASON_MAX, the compiler will complain); whereas if we make it variable, we
leave open the possibility that someone won't update REASON_MAX properly,
resulting in either segfaults (if REASON_MAX is too high) or missing
strings (if REASON_MAX is too low).

 -George

Reply via email to