From 1cf4c56480f883bec50753e092da51ceaf3cea67 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Wed, 19 Mar 2025 16:58:48 +1300 Subject: [PATCH] oauth: Simplify copy of PGoauthBearerRequest Follow-up to 03366b61d. Since there are no more const members in the PGoauthBearerRequest struct, the previous memcpy() can be replaced with simple assignment. Author: Jacob Champion Discussion: https://postgr.es/m/p4bd7mn6dxr2zdak74abocyltpfdxif4pxqzixqpxpetjwt34h%40qc6jgfmoddvq --- src/interfaces/libpq/fe-auth-oauth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c index fb1e9a1a8aa..cf1a25e2ccc 100644 --- a/src/interfaces/libpq/fe-auth-oauth.c +++ b/src/interfaces/libpq/fe-auth-oauth.c @@ -781,7 +781,7 @@ setup_token_request(PGconn *conn, fe_oauth_state *state) goto fail; } - memcpy(request_copy, &request, sizeof(request)); + *request_copy = request; conn->async_auth = run_user_oauth_flow; conn->cleanup_async_auth = cleanup_user_oauth_flow;