1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-20 05:03:10 +03:00

Fix buffer overrun in pg_upgrade.

Problem reported, and cause identified, by Hernan Gonzalez.
This commit is contained in:
Tom Lane
2010-11-02 17:31:54 -04:00
parent e84bf65121
commit 368e44f6a5

View File

@ -545,7 +545,7 @@ putenv2(migratorContext *ctx, const char *var, const char *val)
{ {
#ifndef WIN32 #ifndef WIN32
char *envstr = (char *) pg_malloc(ctx, strlen(var) + char *envstr = (char *) pg_malloc(ctx, strlen(var) +
strlen(val) + 1); strlen(val) + 2);
sprintf(envstr, "%s=%s", var, val); sprintf(envstr, "%s=%s", var, val);
putenv(envstr); putenv(envstr);