]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix potential coredump on bad locale value in pg_upgrade.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Jan 2014 23:10:04 +0000 (18:10 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Jan 2014 23:10:04 +0000 (18:10 -0500)
Thinko in error report (and a typo in the message text, too).  We're
failing anyway, but it would be good to print something useful first.
Noted while reviewing a patch to make pg_upgrade's locale code laxer.

contrib/pg_upgrade/check.c

index 1f67e602defd362d3a8e66ab6b987d71f3df43ec..bacd41e0757289de087af5b5e45f65918049bbac 100644 (file)
@@ -1004,7 +1004,7 @@ get_canonical_locale_name(int category, const char *locale)
        res = setlocale(category, locale);
 
        if (!res)
-               pg_log(PG_FATAL, "failed to get system local name for \"%s\"\n", res);
+               pg_log(PG_FATAL, "failed to get system locale name for \"%s\"\n", locale);
 
        res = pg_strdup(res);