Memory error in src/backend/replication/logical/origin.c

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Memory error in src/backend/replication/logical/origin.c
Date: 2017-11-26 18:07:24
Message-ID: 01EF74C5-F124-49F1-8B1E-53A7CD9ED2B7@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

bool nulls[Natts_pg_replication_origin];
...
memset(&nulls, 0, sizeof(nulls));

around lines 277 through 303. Patch below.

mark

diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index 55382b4b24..88188bd190 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -300,7 +300,7 @@ replorigin_create(char *roname)
* Ok, found an unused roident, insert the new row and do a CCI,
* so our callers can look it up if they want to.
*/
- memset(&nulls, 0, sizeof(nulls));
+ memset(nulls, 0, sizeof(nulls));

values[Anum_pg_replication_origin_roident - 1] = ObjectIdGetDatum(roident);
values[Anum_pg_replication_origin_roname - 1] = roname_d;

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-11-26 18:28:18 Re: Memory error in src/backend/replication/logical/origin.c
Previous Message Joe Conway 2017-11-26 17:53:14 Re: has_sequence_privilege() never got the memo