postgresql/src/backend/commands
Tom Lane 780a342c90 Avoid possibly accessing off the end of memory in examine_attribute().
Since the last couple of columns of pg_type are often NULL,
sizeof(FormData_pg_type) can be an overestimate of the actual size of the
tuple data part.  Therefore memcpy'ing that much out of the catalog cache,
as analyze.c was doing, poses a small risk of copying past the end of
memory and incurring SIGSEGV.  No such crash has been identified in the
field, but we've certainly seen the equivalent happen in other code paths,
so patch this one all the way back.

Per valgrind testing by Noah Misch, though this is not his proposed patch.
I chose to use SearchSysCacheCopy1 rather than inventing special-purpose
infrastructure for copying only the minimal part of a pg_type tuple.
2011-09-06 14:37:22 -04:00
..
aggregatecmds.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
alter.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
analyze.c Avoid possibly accessing off the end of memory in examine_attribute(). 2011-09-06 14:37:22 -04:00
async.c Preserve caller's memory context in ProcessCompletedNotifies(). 2011-05-27 12:10:32 -04:00
cluster.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
collationcmds.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
comment.c Remove rel.h from objectaddress.h; only relcache.h is necessary. 2011-06-28 17:08:29 -04:00
constraint.c Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.h 2011-07-04 14:35:58 -04:00
conversioncmds.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
copy.c Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.h 2011-07-04 14:35:58 -04:00
dbcommands.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
define.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
discard.c Clean up the #include mess a little. 2011-09-04 01:13:16 -04:00
explain.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
extension.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
foreigncmds.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
functioncmds.c Clean up the #include mess a little. 2011-09-04 01:13:16 -04:00
indexcmds.c Clean up the #include mess a little. 2011-09-04 01:13:16 -04:00
lockcmds.c Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
Makefile DDL support for collations 2011-02-12 15:55:18 +02:00
opclasscmds.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
operatorcmds.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
portalcmds.c pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
prepare.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
proclang.c Rethink behavior of CREATE OR REPLACE during CREATE EXTENSION. 2011-07-23 16:59:39 -04:00
schemacmds.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
seclabel.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
sequence.c Clean up the #include mess a little. 2011-09-04 01:13:16 -04:00
tablecmds.c Teach ANALYZE to clear pg_class.relhassubclass when appropriate. 2011-09-02 14:29:31 -04:00
tablespace.c Clean up the #include mess a little. 2011-09-04 01:13:16 -04:00
trigger.c Fix trigger WHEN conditions when both BEFORE and AFTER triggers exist. 2011-08-21 18:15:55 -04:00
tsearchcmds.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
typecmds.c Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.h 2011-07-04 14:35:58 -04:00
user.c Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
vacuum.c Clean up the #include mess a little. 2011-09-04 01:13:16 -04:00
vacuumlazy.c Fix a missed case in code for "moving average" estimate of reltuples. 2011-08-30 14:51:38 -04:00
variable.c Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
view.c Fix bugs in relpersistence handling during table creation. 2011-07-03 17:34:47 -04:00