Fix 1-byte buffer overrun when OID exceeds 1 billion. This probably can't
authorTom Lane <[email protected]>
Wed, 22 Nov 2006 21:13:04 +0000 (21:13 +0000)
committerTom Lane <[email protected]>
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 b416d48379ec534cf17d98fffaac7d63e860e36f..2d92c12d2639a4181f4da883b4144e7bbae639a9 100644 (file)
@@ -892,7 +892,7 @@ PrintQueryResults(PGresult *results)
 
                case PGRES_COMMAND_OK:
                        {
-                               char            buf[10];
+                               char            buf[16];
 
                                success = true;
                                snprintf(buf, sizeof(buf),