On 23.08.2021 16:35, Nigel Croxon wrote:
To meet requirements of Common Criteria certification vulnerability assessment. Static code analysis has been run and found the following error: buffer_size_warning: Calling "strncpy" with a maximum size argument of 16 bytes on destination array "ve->name" of size 16 bytes might leave the destination string unterminated.
Yeah, please ignore my comment to v2- the task here it remove error, not to acknowledge it.
+ int l = strlen(ve->name); + if (l > 16) + l = 16;
I think that whole "if" statement can be replaced by: strnlen(ve->name, sizeof(ve->name))
+ memcpy(ve->name, name, l); + }