mirror of
https://github.com/postgres/postgres.git
synced 2025-05-15 19:15:29 +03:00
This simple patch to catalog/pg_type.c fixes a buffer overrun. It
was detected by Electric Fence and triggered by statements like: SELECT * into table t from pg_database; The system would crash on a memmove call in DataFile() with arguments like this: memmove(0x0, 0x0, 0); Maurice Gittens
This commit is contained in:
parent
dbf34c5c19
commit
ef0eecfa1f
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.20 1998/02/26 04:30:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.21 1998/03/30 17:46:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -318,6 +318,7 @@ TypeCreate(char *typeName,
|
||||
TupleDesc tupDesc;
|
||||
|
||||
Oid argList[8];
|
||||
NameData name;
|
||||
|
||||
|
||||
static ScanKeyData typeKey[1] = {
|
||||
@ -387,7 +388,8 @@ TypeCreate(char *typeName,
|
||||
* ----------------
|
||||
*/
|
||||
i = 0;
|
||||
values[i++] = PointerGetDatum(typeName); /* 1 */
|
||||
namestrcpy(&name,typeName);
|
||||
values[i++] = NameGetDatum(&name); /* 1 */
|
||||
values[i++] = (Datum) GetUserId(); /* 2 */
|
||||
values[i++] = (Datum) internalSize; /* 3 */
|
||||
values[i++] = (Datum) externalSize; /* 4 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user