aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-06-15 19:37:48 +0000
committerBruce Momjian <bruce@momjian.us>2002-06-15 19:37:48 +0000
commitcd7be4d9470c7b035774287817d19055792a097a (patch)
tree2b9176994a843b2eb365440547c7713fd0a02472
parenteeb1dd506855e72e723fc5e0140d7c813b9ef347 (diff)
downloadpostgresql-cd7be4d9470c7b035774287817d19055792a097a.tar.gz
postgresql-cd7be4d9470c7b035774287817d19055792a097a.zip
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
-rw-r--r--src/bin/psql/mainloop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index 06ca83a7fe1..0a6981ed4e3 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.47 2002/03/27 19:16:13 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.48 2002/06/15 19:37:48 momjian Exp $
*/
#include "postgres_fe.h"
#include "mainloop.h"
@@ -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");