From: Bruce Momjian Date: Sat, 15 Jun 2002 19:37:48 +0000 (+0000) Subject: Noted with versions 7.0.3, 7.1.3, and 7.2.1: X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=b78d840b47bcdd30e2000a659c345107d34a1201;p=users%2Fbernd%2Fpostgres.git Noted with versions 7.0.3, 7.1.3, and 7.2.1: The psql interpreter becomes unstable if variable substitutions are used. The debugger GDB was unable to help however mpatrol reports that the sprintf at mainloop.c:389 is steping one byte farther than the allocation. William K. Volkman --- diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index a9d7e453ab..ca5e36a426 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -378,7 +378,8 @@ MainLoop(FILE *source) { out_length = strlen(value); - new = malloc(len + out_length - (1 + in_length) + 1); + /* Allow for 'after' character also 2002-05-27 */ + new = malloc(len + out_length - (1 + in_length) + 1 + 1); if (!new) { psql_error("out of memory\n");