]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix 1-byte buffer overrun when OID exceeds 1 billion. This probably can't
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 Nov 2006 21:13:04 +0000 (21:13 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 Nov 2006 21:13:04 +0000 (21:13 +0000)
cause any serious harm in normal cases, but if you have gcc buffer overrun
checking turned on, that will notice.  Found by Jack Orenstein.  Problem
was already fixed in CVS HEAD.

src/bin/psql/common.c

index c98322ca4c0e353edb5a175a0cffe592a3657b11..90eb0238d7a1aaa3742054d8351d26d234c32715 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000-2005, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.95.4.1 2005/11/04 18:35:51 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.95.4.2 2006/11/22 21:13:04 tgl Exp $
  */
 #include "postgres_fe.h"
 #include "common.h"
@@ -892,7 +892,7 @@ PrintQueryResults(PGresult *results)
 
                case PGRES_COMMAND_OK:
                        {
-                               char            buf[10];
+                               char            buf[16];
 
                                success = true;
                                snprintf(buf, sizeof(buf),