Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 31c3610

Browse files
committed
The buffer overrun while creating sequences turns out to be a read
access overrun. For the sake of doing things properly here is a patch which fixes it. This patch is for the file backend/commands/sequence.c. Maurice Gittens
1 parent 9a0dd4f commit 31c3610

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/commands/sequence.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ DefineSequence(CreateSeqStmt *seq)
8585
Datum value[SEQ_COL_LASTCOL];
8686
char null[SEQ_COL_LASTCOL];
8787
int i;
88+
NameData name;
8889

8990
/* Check and set values */
9091
init_params(seq, &new);
@@ -110,7 +111,8 @@ DefineSequence(CreateSeqStmt *seq)
110111
case SEQ_COL_NAME:
111112
typnam->name = "name";
112113
coldef->colname = "sequence_name";
113-
value[i - 1] = PointerGetDatum(seq->seqname);
114+
namestrcpy(&name, seq->seqname);
115+
value[i - 1] = NameGetDatum(&name);
114116
break;
115117
case SEQ_COL_LASTVAL:
116118
typnam->name = "int4";

0 commit comments

Comments
 (0)