From cad22075bc2ce9c1fbe61e8d3969d4dbdb5bc1f3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 17 Sep 2017 11:35:27 -0400 Subject: [PATCH] Fix bogus size calculation introduced by commit cc5f81366. The elements of RecordCacheArray are TupleDesc, not TupleDesc *. Those are actually the same size, so that this error is harmless, but it's still wrong --- and it might bite us someday, if TupleDesc ever became a struct, say. Per Coverity. --- src/backend/utils/cache/typcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index fd80c128cb..16c52c5a38 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -1386,7 +1386,7 @@ ensure_record_cache_typmod_slot_exists(int32 typmod) RecordCacheArray = (TupleDesc *) repalloc(RecordCacheArray, newlen * sizeof(TupleDesc)); memset(RecordCacheArray + RecordCacheArrayLen, 0, - (newlen - RecordCacheArrayLen) * sizeof(TupleDesc *)); + (newlen - RecordCacheArrayLen) * sizeof(TupleDesc)); RecordCacheArrayLen = newlen; } } -- 2.40.0