diff options
| author | Heikki Linnakangas | 2025-05-08 19:01:25 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2025-05-08 19:01:25 +0000 |
| commit | b28c59a6cd089902e66a91e0d0974da34d1c922b (patch) | |
| tree | b114ea0f8fa89e2251b80ef7ba13a04ef0a25891 /src/backend/utils | |
| parent | 965213d9c56a671086525a65f5427653b4a66350 (diff) | |
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
Diffstat (limited to 'src/backend/utils')
| -rw-r--r-- | src/backend/utils/init/globals.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c index 1847e7c85d3..92b0446b80c 100644 --- a/src/backend/utils/init/globals.c +++ b/src/backend/utils/init/globals.c @@ -50,7 +50,7 @@ pg_time_t MyStartTime; TimestampTz MyStartTimestamp; struct ClientSocket *MyClientSocket; struct Port *MyProcPort; -char MyCancelKey[MAX_CANCEL_KEY_LENGTH]; +uint8 MyCancelKey[MAX_CANCEL_KEY_LENGTH]; int MyCancelKeyLength = 0; int MyPMChildSlot; |
