From e8d516f0f0fe989cc623de7c339762c6140e55bf Mon Sep 17 00:00:00 2001 From: Halil Ozan Akgul Date: Fri, 10 Mar 2023 12:32:50 +0300 Subject: [PATCH] fix strcpy_s --- src/backend/distributed/utils/attribute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/distributed/utils/attribute.c b/src/backend/distributed/utils/attribute.c index 54b2d5b22..274a4f709 100644 --- a/src/backend/distributed/utils/attribute.c +++ b/src/backend/distributed/utils/attribute.c @@ -205,7 +205,7 @@ AttributeQueryIfAnnotated(const char *query_string, CmdType commandType) } /* attributeToTenant = (char *) malloc(strlen(tenantId)); */ - strcpy_s(attributeToTenant, tenantId); + strcpy_s(attributeToTenant, sizeof(attributeToTenant), tenantId); } else { @@ -550,7 +550,7 @@ CreateTenantStats(MultiTenantMonitor *monitor) { int tenantIndex = monitor->tenantCount; - strcpy_s(monitor->tenants[tenantIndex].tenantAttribute, attributeToTenant); + strcpy_s(monitor->tenants[tenantIndex].tenantAttribute, sizeof(monitor->tenants[tenantIndex].tenantAttribute), attributeToTenant); monitor->tenants[tenantIndex].colocationGroupId = colocationGroupId; monitor->tenants[tenantIndex].namedLockTranche.trancheId = LWLockNewTrancheId();