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();