Fix off-by-one error in query cache module.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 6 Jul 2019 23:08:25 +0000 (08:08 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 6 Jul 2019 23:08:25 +0000 (08:08 +0900)
When debug print is enabled, it might had tried to access out of bound
of oid array.

src/query_cache/pool_memqcache.c

index a13e8f073e0021e08784dcbad2f6aef0d5d64c30..ed0c94dde414b199e3c893c428c80eeb000354e1 100644 (file)
@@ -1169,7 +1169,7 @@ pool_extract_table_oids(Node *node, int **oidsp)
                 */
                foreach(cell, stmt->objects)
                {
-                       if (num_oids > POOL_MAX_DML_OIDS)
+                       if (num_oids >= POOL_MAX_DML_OIDS)
                        {
                                ereport(LOG,
                                                (errmsg("memcache: error while extracting table oids. too many oids:%d", num_oids)));