Skip site navigation (1) Skip section navigation (2)

found another overrun

From: Maurice Gittens <mgittens(at)david(dot)gits(dot)nl>
To: hackers(at)postgresql(dot)org
Subject: found another overrun
Date: 1998-03-29 12:33:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
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); 

Here's the patch.

> 	NameData	 	name;
< 	values[i++] = PointerGetDatum(typeName);	/* 1 */
> 	namestrcpy(&name,typeName);
> 	values[i++] = NameGetDatum(&name);	/* 1 */

After applying the patch the problem goes away.

I'll try to make all the buffer overruns detected by Electric Fence
during the regression test on my Linux system go away -:).
Debugging is a nice way to learn about a system isn't it?

With regards from Maurice.


pgsql-hackers by date

Next:From: Michal MosiewiczDate: 1998-03-29 14:17:29
Subject: Re: [HACKERS] Optimizer fails?
Previous:From: Bruce MomjianDate: 1998-03-29 04:53:56
Subject: Re: (PM) Re: [HACKERS] Ways to crash the backend

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group