Re: [PATCH] net/mlx5: simplify mlx5_set_driver_version string assignments

2023-10-12 Thread Saeed Mahameed
On 11 Oct 14:34, Kees Cook wrote: On Wed, Oct 11, 2023 at 09:29:57PM +, Justin Stitt wrote: In total, just assigning this version string takes: (1) strncpy()'s (5) strlen()'s (3) strncat()'s (1) snprintf()'s (4) max_t()'s Moreover, `strncpy` is deprecated [1] and `strncat` really shouldn't

Re: [PATCH] net/mlx5: simplify mlx5_set_driver_version string assignments

2023-10-11 Thread Kees Cook
On Wed, Oct 11, 2023 at 09:29:57PM +, Justin Stitt wrote: > In total, just assigning this version string takes: > (1) strncpy()'s > (5) strlen()'s > (3) strncat()'s > (1) snprintf()'s > (4) max_t()'s > > Moreover, `strncpy` is deprecated [1] and `strncat` really shouldn't be > used either [2].

[PATCH] net/mlx5: simplify mlx5_set_driver_version string assignments

2023-10-11 Thread Justin Stitt
In total, just assigning this version string takes: (1) strncpy()'s (5) strlen()'s (3) strncat()'s (1) snprintf()'s (4) max_t()'s Moreover, `strncpy` is deprecated [1] and `strncat` really shouldn't be used either [2]. With this in mind, let's simply use a single `snprintf`. Link: https://www.ke