From fcea9e9bcaebcb3ab7db2a4810cc1fdc936d21fc Mon Sep 17 00:00:00 2001 From: David Cooper Date: Wed, 17 Jun 2020 10:21:07 -0400 Subject: [PATCH] Fix compile error libpki will not compile on CentOS 8. It fails with an error on line 86 of src/pki_config.c: error: 'strncpy' specified bound depends on the length of the source argument. Since the destination buffer, ret, is allocated a buffer of size strlen(my_search)+1, there doesn't seem to be a reason to use strncpy rather than strcpy. --- src/pki_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pki_config.c b/src/pki_config.c index cccf6ca..95874a4 100644 --- a/src/pki_config.c +++ b/src/pki_config.c @@ -83,7 +83,7 @@ static char * _xml_search_namespace_add ( char *search ) { PKI_Free( my_arg ); ret = PKI_Malloc ( strlen( my_search ) + 1); - strncpy( ret, my_search, strlen(my_search) ); + strcpy( ret, my_search ); PKI_Free ( my_search ); return( ret );