1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-10 14:22:35 +03:00

Properly detoast access to bytea field pg_trigger.tgargs. Old code

might cause server crash.

Backpatch to 8.2.X.
This commit is contained in:
Bruce Momjian
2007-01-25 04:17:56 +00:00
parent 4e978c4e27
commit ebe2830613
3 changed files with 6 additions and 9 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.206 2006/10/13 21:43:18 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.206.2.1 2007/01/25 04:17:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1790,8 +1790,7 @@ update_ri_trigger_args(Oid relid,
* line; so does trigger.c ...
*/
tgnargs = pg_trigger->tgnargs;
val = (bytea *)
DatumGetPointer(fastgetattr(tuple,
val = DatumGetByteaP(fastgetattr(tuple,
Anum_pg_trigger_tgargs,
tgrel->rd_att, &isnull));
if (isnull || tgnargs < RI_FIRST_ATTNAME_ARGNO ||

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.210 2006/11/23 01:14:59 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.210.2.1 2007/01/25 04:17:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -906,8 +906,7 @@ RelationBuildTriggers(Relation relation)
char *p;
int i;
val = (bytea *)
DatumGetPointer(fastgetattr(htup,
val = DatumGetByteaP(fastgetattr(htup,
Anum_pg_trigger_tgargs,
tgrel->rd_att, &isnull));
if (isnull)