Commit 31c36102 authored by Bruce Momjian's avatar Bruce Momjian

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
parent 9a0dd4fb
...@@ -85,6 +85,7 @@ DefineSequence(CreateSeqStmt *seq) ...@@ -85,6 +85,7 @@ DefineSequence(CreateSeqStmt *seq)
Datum value[SEQ_COL_LASTCOL]; Datum value[SEQ_COL_LASTCOL];
char null[SEQ_COL_LASTCOL]; char null[SEQ_COL_LASTCOL];
int i; int i;
NameData name;
/* Check and set values */ /* Check and set values */
init_params(seq, &new); init_params(seq, &new);
...@@ -110,7 +111,8 @@ DefineSequence(CreateSeqStmt *seq) ...@@ -110,7 +111,8 @@ DefineSequence(CreateSeqStmt *seq)
case SEQ_COL_NAME: case SEQ_COL_NAME:
typnam->name = "name"; typnam->name = "name";
coldef->colname = "sequence_name"; coldef->colname = "sequence_name";
value[i - 1] = PointerGetDatum(seq->seqname); namestrcpy(&name, seq->seqname);
value[i - 1] = NameGetDatum(&name);
break; break;
case SEQ_COL_LASTVAL: case SEQ_COL_LASTVAL:
typnam->name = "int4"; typnam->name = "int4";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment