From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays |
Date: | 2025-05-08 19:11:02 |
Message-ID: | E1uD6e6-000omO-1n@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays
A 'void *' argument suggests that the caller might pass an arbitrary
struct, which is appropriate for functions like libc's read/write, or
pq_sendbytes(). 'uint8 *' is more appropriate for byte arrays that
have no structure, like the cancellation keys or SCRAM tokens. Some
places used 'char *', but 'uint8 *' is better because 'char *' is
commonly used for null-terminated strings. Change code around SCRAM,
MD5 authentication, and cancellation key handling to follow these
conventions.
Discussion: https://www.postgresql.org/message-id/61be9e31-7b7d-49d5-bc11-721800d89d64@eisentraut.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b28c59a6cd089902e66a91e0d0974da34d1c922b
Modified Files
--------------
contrib/dblink/dblink.c | 4 ++--
contrib/postgres_fdw/connection.c | 4 ++--
src/backend/libpq/auth-scram.c | 32 ++++++++++++++++----------------
src/backend/libpq/auth.c | 4 ++--
src/backend/libpq/crypt.c | 6 +++---
src/backend/storage/ipc/procsignal.c | 6 +++---
src/backend/utils/init/globals.c | 2 +-
src/common/base64.c | 16 ++++++++--------
src/common/md5_common.c | 4 ++--
src/common/scram-common.c | 10 +++++-----
src/include/common/base64.h | 4 ++--
src/include/common/md5.h | 4 ++--
src/include/common/scram-common.h | 4 ++--
src/include/libpq/auth.h | 2 +-
src/include/libpq/crypt.h | 2 +-
src/include/libpq/pqcomm.h | 2 +-
src/include/miscadmin.h | 2 +-
src/include/storage/procsignal.h | 4 ++--
src/interfaces/libpq/fe-auth-scram.c | 14 +++++++-------
src/interfaces/libpq/fe-auth.c | 8 ++++----
src/interfaces/libpq/fe-cancel.c | 2 +-
src/interfaces/libpq/fe-misc.c | 10 +++++-----
src/interfaces/libpq/fe-protocol3.c | 4 ++--
src/interfaces/libpq/libpq-int.h | 10 +++++-----
24 files changed, 80 insertions(+), 80 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2025-05-08 19:11:07 | Re: pgsql: Make cancel request keys longer |
Previous Message | Bruce Momjian | 2025-05-08 15:11:33 | pgsql: PG 18 relnotes: adjust RETURNING new/old item |