Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5af6b2a

Browse files
committed
Properly detoast access to bytea field pg_trigger.tgargs. Old code
might cause server crash.Backpatch to 8.2.X.
1 parent2512817 commit5af6b2a

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.210 2007/01/05 22:19:26 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.211 2007/01/25 04:17:45 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1800,8 +1800,7 @@ update_ri_trigger_args(Oid relid,
18001800
* line; so does trigger.c ...
18011801
*/
18021802
tgnargs=pg_trigger->tgnargs;
1803-
val= (bytea*)
1804-
DatumGetPointer(fastgetattr(tuple,
1803+
val=DatumGetByteaP(fastgetattr(tuple,
18051804
Anum_pg_trigger_tgargs,
18061805
tgrel->rd_att,&isnull));
18071806
if (isnull||tgnargs<RI_FIRST_ATTNAME_ARGNO||

‎src/backend/commands/trigger.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.211 2007/01/05 22:19:26 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.212 2007/01/25 04:17:46 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -906,8 +906,7 @@ RelationBuildTriggers(Relation relation)
906906
char*p;
907907
inti;
908908

909-
val= (bytea*)
910-
DatumGetPointer(fastgetattr(htup,
909+
val=DatumGetByteaP(fastgetattr(htup,
911910
Anum_pg_trigger_tgargs,
912911
tgrel->rd_att,&isnull));
913912
if (isnull)

‎src/backend/utils/adt/ruleutils.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.245 2007/01/20 23:13:01 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.246 2007/01/25 04:17:46 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -529,8 +529,7 @@ pg_get_triggerdef(PG_FUNCTION_ARGS)
529529
char*p;
530530
inti;
531531

532-
val= (bytea*)
533-
DatumGetPointer(fastgetattr(ht_trig,
532+
val=DatumGetByteaP(fastgetattr(ht_trig,
534533
Anum_pg_trigger_tgargs,
535534
tgrel->rd_att,&isnull));
536535
if (isnull)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp