Attention is currently required from: Bao Zheng, Martin L Roth, Karthik Ramasubramanian, Felix Held.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/70778 )
Change subject: util/amdfwtool: Write EFS and AMDFW body in separate files ......................................................................
Patch Set 3:
(1 comment)
File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/70778/comment/c40d2824_64034624 PS3, Line 1962: file_name_len = strlen(output) + strlen(EFS_FILE_SUFFIX) + strlen(TMP_FILE_SUFFIX) + 1; : if (file_name_len > PATH_MAX) { : fprintf(stderr, "EFS File name len %zu > %u\n", file_name_len, PATH_MAX); : exit(1); : } You can check the return value of `snprintf` instead.
The functions snprintf() and vsnprintf() do not write more than size bytes (including the terminating null byte ('\0')). If the output was truncated due to this limit, then the return value is the number of characters (excluding the terminating null byte) which would have been written to the final string if enough space had been available. Thus, a return value of size or more means that the output was truncated. (See also below under NOTES.)