diff options
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/crossystem.c | 6 | ||||
-rw-r--r-- | host/lib/include/crossystem_arch.h | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index b4824332..b4962591 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -3,6 +3,7 @@ * found in the LICENSE file. */ +#include <stddef.h> #include <stdio.h> #include <string.h> #include <sys/types.h> @@ -69,7 +70,7 @@ typedef enum VbBuildOption { /* Return true if the FWID starts with the specified string. */ int FwidStartsWith(const char *start) { - char fwid[128]; + char fwid[VB_MAX_STRING_PROPERTY]; if (!VbGetSystemPropertyString("fwid", fwid, sizeof(fwid))) return 0; @@ -492,7 +493,8 @@ int VbGetSystemPropertyInt(const char* name) { } -const char* VbGetSystemPropertyString(const char* name, char* dest, int size) { +const char* VbGetSystemPropertyString(const char* name, char* dest, + size_t size) { static const char unknown_string[] = "unknown"; /* Check architecture-dependent properties first */ diff --git a/host/lib/include/crossystem_arch.h b/host/lib/include/crossystem_arch.h index 4044c749..50198b07 100644 --- a/host/lib/include/crossystem_arch.h +++ b/host/lib/include/crossystem_arch.h @@ -8,6 +8,8 @@ #ifndef VBOOT_REFERENCE_CROSSYSTEM_ARCH_H_ #define VBOOT_REFERENCE_CROSSYSTEM_ARCH_H_ +#include <stddef.h> + #include "vboot_nvstorage.h" #include "vboot_struct.h" @@ -76,7 +78,7 @@ int VbGetArchPropertyInt(const char* name); * will be truncated. * * Returns the passed buffer, or NULL if error. */ -const char* VbGetArchPropertyString(const char* name, char* dest, int size); +const char* VbGetArchPropertyString(const char* name, char* dest, size_t size); /* Set an architecture-specific system property integer. * |