You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch

34 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

From 78f018a79243b8aa3c2a8e8aa87245c58c731278 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sun, 16 Sep 2018 13:29:59 +0300
Subject: [PATCH] tpmd_dev: fix strncpy bound
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
tpmd_dev/linux/tpmd_dev.c:88:3: error: strncpy specified bound 108 equals destination size [-Werror=stringop-truncation]
Bug: https://github.com/PeterHuewe/tpm-emulator/pull/43
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
tpmd_dev/linux/tpmd_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tpmd_dev/linux/tpmd_dev.c b/tpmd_dev/linux/tpmd_dev.c
index 2b24bd7..72583f4 100644
--- a/tpmd_dev/linux/tpmd_dev.c
+++ b/tpmd_dev/linux/tpmd_dev.c
@@ -85,7 +85,7 @@ static int tpmd_connect(char *socket_name)
return res;
}
addr.sun_family = AF_UNIX;
- strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path));
+ strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path)-1);
res = tpmd_sock->ops->connect(tpmd_sock,
(struct sockaddr*)&addr, sizeof(struct sockaddr_un), 0);
if (res != 0) {
--
2.16.4