From ae45e93aaf9cc1257d46e47631c7ef7feb202702 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Sun, 7 Jul 2019 08:08:25 +0900 Subject: [PATCH] Fix off-by-one error in query cache module. When debug print is enabled, it might had tried to access out of bound of oid array. --- src/query_cache/pool_memqcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query_cache/pool_memqcache.c b/src/query_cache/pool_memqcache.c index 2055246a5..3eaa72308 100644 --- a/src/query_cache/pool_memqcache.c +++ b/src/query_cache/pool_memqcache.c @@ -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))); -- 2.39.5