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:12:57 +0000 (21:12 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 Nov 2006 21:12:57 +0000 (21:12 +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 08056038d36c23951563da72a0637eec9edb79f1..beb5cd3e89285eaee952d0a430c27d4f9644467c 100644 (file)
@@ -903,7 +903,7 @@ PrintQueryResults(PGresult *results)
 
                case PGRES_COMMAND_OK:
                        {
-                               char            buf[10];
+                               char            buf[16];
 
                                success = true;
                                snprintf(buf, sizeof(buf),