pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix unsafe reference into relcache in constructed CommentStmt. 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix unsafe reference into relcache in constructed CommentStmt. @ 2017-05-15 15:33 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2017-05-15 15:33 UTC (permalink / raw) To: pgsql-committers Fix unsafe reference into relcache in constructed CommentStmt. The CommentStmt made by RebuildConstraintComment() has to pstrdup the relation name, else it will contain a dangling pointer after that relcache entry is flushed. (I'm less sure that pstrdup'ing conname is necessary, but let's be safe.) Failure to do this leads to weird errors or crashes, as reported by Marko Elezovic. Bug introduced by commit e42375fc8, so back-patch to 9.5 as that was. Fix by David Rowley, regression test by Michael Paquier Discussion: https://postgr.es/m/DB6PR03MB30775D58E732D4EB0C13725B9AE00@DB6PR03MB3077.eurprd03.prod.outlook.com Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/53a1aa9f9a6f3711ff5766beca135ddce3f3b4ad Modified Files -------------- src/backend/commands/tablecmds.c | 4 ++-- src/test/regress/expected/alter_table.out | 33 +++++++++++++++++++++++++++++++ src/test/regress/sql/alter_table.sql | 18 +++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix unsafe reference into relcache in constructed CommentStmt. @ 2017-05-15 15:33 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2017-05-15 15:33 UTC (permalink / raw) To: pgsql-committers Fix unsafe reference into relcache in constructed CommentStmt. The CommentStmt made by RebuildConstraintComment() has to pstrdup the relation name, else it will contain a dangling pointer after that relcache entry is flushed. (I'm less sure that pstrdup'ing conname is necessary, but let's be safe.) Failure to do this leads to weird errors or crashes, as reported by Marko Elezovic. Bug introduced by commit e42375fc8, so back-patch to 9.5 as that was. Fix by David Rowley, regression test by Michael Paquier Discussion: https://postgr.es/m/DB6PR03MB30775D58E732D4EB0C13725B9AE00@DB6PR03MB3077.eurprd03.prod.outlook.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b35cce914cd3eef7d4a2471073c80f709d724e5a Modified Files -------------- src/backend/commands/tablecmds.c | 4 ++-- src/test/regress/expected/alter_table.out | 33 +++++++++++++++++++++++++++++++ src/test/regress/sql/alter_table.sql | 18 +++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix unsafe reference into relcache in constructed CommentStmt. @ 2017-05-15 15:33 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2017-05-15 15:33 UTC (permalink / raw) To: pgsql-committers Fix unsafe reference into relcache in constructed CommentStmt. The CommentStmt made by RebuildConstraintComment() has to pstrdup the relation name, else it will contain a dangling pointer after that relcache entry is flushed. (I'm less sure that pstrdup'ing conname is necessary, but let's be safe.) Failure to do this leads to weird errors or crashes, as reported by Marko Elezovic. Bug introduced by commit e42375fc8, so back-patch to 9.5 as that was. Fix by David Rowley, regression test by Michael Paquier Discussion: https://postgr.es/m/DB6PR03MB30775D58E732D4EB0C13725B9AE00@DB6PR03MB3077.eurprd03.prod.outlook.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/12590c5d33d013e55995c0c0ea6c70262a6d13b3 Modified Files -------------- src/backend/commands/tablecmds.c | 4 ++-- src/test/regress/expected/alter_table.out | 33 +++++++++++++++++++++++++++++++ src/test/regress/sql/alter_table.sql | 18 +++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2017-05-15 15:33 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-05-15 15:33 pgsql: Fix unsafe reference into relcache in constructed CommentStmt. Tom Lane <tgl@sss.pgh.pa.us> 2017-05-15 15:33 pgsql: Fix unsafe reference into relcache in constructed CommentStmt. Tom Lane <tgl@sss.pgh.pa.us> 2017-05-15 15:33 pgsql: Fix unsafe reference into relcache in constructed CommentStmt. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox