mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Fix buffer overrun in pg_upgrade.
Problem reported, and cause identified, by Hernan Gonzalez.
This commit is contained in:
parent
9f376e146b
commit
71baff1786
@ -545,7 +545,7 @@ putenv2(const char *var, const char *val)
|
|||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
char *envstr = (char *) pg_malloc(strlen(var) +
|
char *envstr = (char *) pg_malloc(strlen(var) +
|
||||||
strlen(val) + 1);
|
strlen(val) + 2);
|
||||||
|
|
||||||
sprintf(envstr, "%s=%s", var, val);
|
sprintf(envstr, "%s=%s", var, val);
|
||||||
putenv(envstr);
|
putenv(envstr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user