summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2020-09-03 15:46:47 -0600
committerCommit Bot <commit-bot@chromium.org>2020-09-15 04:35:42 +0000
commit3f96c587e972e926badb50a15d4040e3ace8da62 (patch)
treeaee337c7fbcf281e7e20c284da226af855700ff7
parent750da40fb8a9b6692d2ce6df39e527f5120c128c (diff)
downloadvboot-3f96c587e972e926badb50a15d4040e3ace8da62.tar.gz
host: Make gpiochip path buffer larger
The name of a gpiochip can in theory be up to NAME_MAX characters long (usually 255), which exceeds the length of the 30 byte buffer allocated for it. In practice we won't need more than the 30 bytes, but the smaller buffer trips a -Wformat-truncation warning from GCC that makes the build fail. Make the buffer bigger to keep GCC happy. BUG=none BRANCH=none TEST=make utillib compiles on BeagleBone Black Change-Id: I528f395033f58057846e717ff126e7a5dca504e3 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2393193 Tested-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Commit-Queue: Joel Kitching <kitching@chromium.org>
-rw-r--r--host/arch/arm/lib/crossystem_arch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c
index d16012a2..f2e432f9 100644
--- a/host/arch/arm/lib/crossystem_arch.c
+++ b/host/arch/arm/lib/crossystem_arch.c
@@ -288,7 +288,7 @@ static int gpiod_read(const char *name, bool active_low)
return -1;
for (i = 0; i < max; i++) {
- char buf[30];
+ char buf[5 + NAME_MAX + 1];
int fd;
snprintf(buf, sizeof(buf), "/dev/%s", list[i]->d_name);