AddressSanitizer: stack-use-after-scope on address in CreateBackground(backport to release-13.0) (#7966)

Backport of #7943 to release-13.0
Fixes #7964
pull/7963/head^2
manaldush 2025-04-25 14:29:47 +03:00 committed by GitHub
parent da6cab83d8
commit 20a2d33f2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -2955,6 +2955,8 @@ CreateBackgroundJob(const char *jobType, const char *description)
/* insert new job */
Datum values[Natts_pg_dist_background_job] = { 0 };
bool isnull[Natts_pg_dist_background_job] = { 0 };
NameData jobTypeName = { 0 };
memset(isnull, true, sizeof(isnull));
int64 jobId = GetNextBackgroundJobsJobId();
@ -2967,7 +2969,6 @@ CreateBackgroundJob(const char *jobType, const char *description)
if (jobType)
{
NameData jobTypeName = { 0 };
namestrcpy(&jobTypeName, jobType);
InitFieldValue(Anum_pg_dist_background_job_job_type, values, isnull,
NameGetDatum(&jobTypeName));