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:41 -04:00
parent 9f376e146b
commit 71baff1786
1 changed files with 1 additions and 1 deletions

View File

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