aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2012-12-20 13:56:24 -0500
committerBruce Momjian <bruce@momjian.us>2012-12-20 13:56:31 -0500
commitdc9896a2457f0d72458f1ff45935362521f0f99c (patch)
treef164a0b8469a13d1fce221f42263fa826514df7f /src
parentaf275a12dfeecd621ed9899a9382f26a68310263 (diff)
downloadpostgresql-dc9896a2457f0d72458f1ff45935362521f0f99c.tar.gz
postgresql-dc9896a2457f0d72458f1ff45935362521f0f99c.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/bin/initdb/initdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 40740dcb723..3e05ac3309f 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -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;