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:15:53 +0000 (08:15 +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 112a95068c1b5ee6c5ae9267638a595aa233b981..677008b5dd1a38ea61b76e82abc79b7b2cc2487c 100644 (file)
@@ -1032,7 +1032,7 @@ int 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)));