From ee8970c11e87b5fe4fdde51e3d09c209f89de1c3 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Tue, 15 Jan 2019 15:34:00 +0100 Subject: [PATCH] Fix strncpy gcc warning. --- lib/crypto_backend/crypto_kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crypto_backend/crypto_kernel.c b/lib/crypto_backend/crypto_kernel.c index 934a774b..c78ce848 100644 --- a/lib/crypto_backend/crypto_kernel.c +++ b/lib/crypto_backend/crypto_kernel.c @@ -190,7 +190,7 @@ int crypt_hash_init(struct crypt_hash **ctx, const char *name) } h->hash_len = ha->length; - strncpy((char *)sa.salg_name, ha->kernel_name, sizeof(sa.salg_name)); + strncpy((char *)sa.salg_name, ha->kernel_name, sizeof(sa.salg_name)-1); if (crypt_kernel_socket_init(&sa, &h->tfmfd, &h->opfd, NULL, 0) < 0) { free(h);