mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Avoid using NAMEDATALEN in pg_upgrade
Because the client encoding might not match the server encoding, pg_upgrade can't allocate NAMEDATALEN bytes for storage of database, relation, and namespace identifiers. Instead pg_strdup() the memory and free it. Also add C comment in initdb.c about safe NAMEDATALEN usage.
This commit is contained in:
@ -1836,7 +1836,7 @@ setup_collation(void)
|
||||
#if defined(HAVE_LOCALE_T) && !defined(WIN32)
|
||||
int i;
|
||||
FILE *locale_a_handle;
|
||||
char localebuf[NAMEDATALEN];
|
||||
char localebuf[NAMEDATALEN]; /* we assume ASCII so this is fine */
|
||||
int count = 0;
|
||||
|
||||
PG_CMD_DECL;
|
||||
|
Reference in New Issue
Block a user