x86/crossystem: Fix snprintf error for hostlib
Build bot in upstream coreboot builds vboot hostlib (for utils such as
cbfstool) with Debian 12.2.0-14 cc (from latest docker image
coreboot/coreboot-sdk:2023-06-04_44f676afc9). An attempt to update the
vboot submodule in upstream coreboot causes build failure:
host/arch/x86_64/lib/crossystem_arch.c:862:50: error: ā%dā directive
output may be truncated writing between 1 and 10 bytes into a region of
size between 0 and 127 [-Werror=format-truncation=]
host/arch/x86_64/lib/crossystem_arch.c:862:46: note: directive argument
in the range [0, 2147483647]
862 | snprintf(name, sizeof(name), "%s.%d/GPIO.0", ...
| ^~~~~~~~~~~~~~
where the code was added in CL:4719310. Fix the problem by increasing
the array size of `name`.
BUG=b:291036452
TEST=Ran "make -C util/cbfstool" from coreboot with Debian 12.2.0-14 cc
BRANCH=none
Change-Id: Id038a706f7c70e2a18be72a2d6055f25e35006b0
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4763610
Reviewed-by: Tzung-Bi Shih <tzungbi@chromium.org>
Commit-Queue: Tzung-Bi Shih <tzungbi@chromium.org>
1 file changed