diff options
author | Alon Bar-Lev <alonbl@gentoo.org> | 2018-09-16 13:35:46 +0300 |
---|---|---|
committer | Alon Bar-Lev <alonbl@gentoo.org> | 2018-09-16 13:38:13 +0300 |
commit | 96278bd867bd974b6200863215ec5aec3d31503a (patch) | |
tree | 279fbbb45029688bac4454f5958a1c855caaa7c3 /app-crypt/tpm-emulator | |
parent | 580ab49ecf2abf7385c8b2bc9fb221cf8f97af6b (diff) | |
download | gentoo-96278bd867bd974b6200863215ec5aec3d31503a.tar.gz gentoo-96278bd867bd974b6200863215ec5aec3d31503a.tar.xz |
app-crypt/tpm-emulator: fix strncpy build
Closes: https://bugs.gentoo.org/show_bug.cgi?id=666326
Thanks: Toralf Förster
Diffstat (limited to 'app-crypt/tpm-emulator')
-rw-r--r-- | app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch | 33 | ||||
-rw-r--r-- | app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild | 4 |
2 files changed, 37 insertions, 0 deletions
diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch new file mode 100644 index 00000000000..3f96bdd3e68 --- /dev/null +++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-build.patch @@ -0,0 +1,33 @@ +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 + diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild b/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild index 70301caebee..97b70a4785f 100644 --- a/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild +++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.5.ebuild @@ -22,6 +22,10 @@ RDEPEND="ssl? ( DEPEND="${RDEPEND} !ssl? ( dev-libs/gmp )" +PATCHES=( + "${FILESDIR}/${P}-build.patch" +) + pkg_setup() { enewgroup tss enewuser tss -1 -1 /var/lib/tpm tss |