Skip to content

Commit 0713d52

Browse files
committed
provider: Fix a sanitizer build warning
p_ibmca.c:882:9: warning: '__builtin_strncpy' specified bound 4096 equals destination size [-Wstringop-truncation] 882 | strncpy(prov_name, provctx->name, sizeof(prov_name)); | ^ Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
1 parent a358f59 commit 0713d52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/provider/p_ibmca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static int ibmca_config_debug(struct ibmca_prov_ctx *provctx,
879879
if (provctx->debug == true) {
880880
provctx->debug_pid = getpid();
881881

882-
strncpy(prov_name, provctx->name, sizeof(prov_name));
882+
strncpy(prov_name, provctx->name, sizeof(prov_name) - 1);
883883
prov_name[sizeof(prov_name) - 1] = '\0';
884884
while ((p = strchr(prov_name, '/')) != NULL)
885885
*p = '_';

0 commit comments

Comments
 (0)