postgresql/src/backend
Tom Lane b35cce914c 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
2017-05-15 11:33:44 -04:00
..
access Fix pfree-of-already-freed-tuple when rescanning a GiST index-only scan. 2017-05-04 13:59:13 -04:00
bootstrap Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
catalog Match pg_user_mappings limits to information_schema.user_mapping_options. 2017-05-08 07:24:27 -07:00
commands Fix unsafe reference into relcache in constructed CommentStmt. 2017-05-15 11:33:44 -04:00
executor Avoid passing function pointers across process boundaries. 2017-04-15 16:23:27 -04:00
foreign Remove GetUserMappingId() and GetUserMappingById(). 2016-07-22 11:32:23 -04:00
lib Revert "Permit dump/reload of not-too-large >1GB tuples" 2016-12-06 12:46:03 -03:00
libpq Fix unportable disregard of alignment requirements in RADIUS code. 2017-03-26 17:35:35 -04:00
main Repair a bit of pgindent damage. 2016-06-09 18:09:17 -04:00
nodes Fix parallel query so it doesn't spoil row estimates above Gather. 2017-03-31 21:10:30 -04:00
optimizer Always build a custom plan node's targetlist from the path's pathtarget. 2017-04-17 15:29:00 -04:00
parser Fix YA unwanted behavioral difference with operator_precedence_warning. 2017-02-15 14:44:00 -05:00
po Translation updates 2017-05-08 10:10:54 -04:00
port Provide a way to control SysV shmem attach address in EXEC_BACKEND builds. 2017-04-15 17:27:51 -04:00
postmaster Allow multiple bgworkers to be launched per postmaster iteration. 2017-04-26 16:17:29 -04:00
regex Fix regexport.c to behave sanely with lookaround constraints. 2017-04-13 17:18:35 -04:00
replication Avoid superfluous work for commits during logical slot creation. 2017-05-13 15:06:40 -07:00
rewrite RLS: Fix ALL vs. SELECT+UPDATE policy usage 2017-05-06 21:46:41 -04:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Cope with glibc too old to have epoll_create1(). 2017-04-27 17:13:54 -04:00
tcop Remove dead code and fix comments in fast-path function handling. 2017-04-06 09:11:11 +03:00
tsearch Fix typos in comments. 2017-02-06 11:34:15 +02:00
utils Avoid searching for callback functions in CallSyscacheCallbacks(). 2017-05-12 19:05:28 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Provide and use a makefile target to build all generated headers. 2016-07-01 15:09:02 -04:00
nls.mk Translation updates 2017-02-06 12:42:47 -05:00