summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vendorcode/google/chromeos/cros_vpd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/cros_vpd.c b/src/vendorcode/google/chromeos/cros_vpd.c
index fed1d82344..f9aec88f36 100644
--- a/src/vendorcode/google/chromeos/cros_vpd.c
+++ b/src/vendorcode/google/chromeos/cros_vpd.c
@@ -132,7 +132,8 @@ char *cros_vpd_gets(const char *key, char *buffer, int size)
return NULL;
if (size > (string_size + 1)) {
- strcpy(buffer, string_address);
+ memcpy(buffer, string_address, string_size);
+ buffer[string_size] = '\0';
} else {
memcpy(buffer, string_address, size - 1);
buffer[size - 1] = '\0';