Skip to content

Commit

Permalink
FIX strncpy warning in apps/cmp.c.
Browse files Browse the repository at this point in the history
bugfix: openssl#12872

strncpy here has compiling warning of -Wstringop-truncation, change
into BIO_snprintf as before.

Change-Id: I362872c4ad328cadd4c7a5a5da3165655fa26c0d

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: David von Oheimb <[email protected]>
(Merged from openssl#12889)
  • Loading branch information
xffbai authored and DDvO committed Sep 17, 2020
1 parent 1cae59d commit ebcae87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
CMP_err("missing -tls_used option since -server URL indicates https");
goto err;
}
strncpy(server_port, port, sizeof(server_port));
BIO_snprintf(server_port, sizeof(server_port), "%s", port);
used_path = opt_path != NULL ? opt_path : path;
if (!OSSL_CMP_CTX_set1_server(ctx, server)
|| !OSSL_CMP_CTX_set_serverPort(ctx, portnum)
Expand Down

0 comments on commit ebcae87

Please sign in to comment.