Re: Buffer overflow in psql

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Buffer overflow in psql
Дата
Msg-id
2008.1164215233@sss.pgh.pa.us
Ответ на
Buffer overflow in psql (Jack Orenstein)
Список
Дерево обсуждения
Buffer overflow in psql Jack Orenstein <jorenstein@archivas.com>
Re: Buffer overflow in psql Martijn van Oosterhout <kleptog@svana.org>
Re: Buffer overflow in psql Tom Lane <tgl@sss.pgh.pa.us>
Re: Buffer overflow in psql Jack Orenstein <jorenstein@archivas.com>
Re: Buffer overflow in psql Tom Lane <tgl@sss.pgh.pa.us>
Re: Buffer overflow in psql "John D. Burger" <john@mitre.org>
Re: Buffer overflow in psql Tom Lane <tgl@sss.pgh.pa.us>
Re: Buffer overflow in psql "John D. Burger" <john@mitre.org>
Jack Orenstein  writes:
> The problem has occurred again, and I've found a buffer overflow in
> psql that explains it. Here is code from src/bin/psql/common.c, from
> the PrintQueryResults function:

> 		case PGRES_COMMAND_OK:
> 			{
> 				char		buf[10];

> 				success = true;
> 				sprintf(buf, "%u", (unsigned int) PQoidValue(results));

Good catch!  What platform and compiler are you using exactly?  I'd
imagine that on most platforms, the size of that array is effectively
rounded up to 12 bytes due to alignment/padding considerations, which
would mask the mistake.  Yours must somehow be putting something
critical right after the array.

> 1) Is one of the postgresql developers willing to get this fix into
>     the next release? (We're patching our own 7.4.8 build.)

Yeah, we'll fix it.

			regards, tom lane
В списке pgsql-general по дате отправления
От: Alvaro Herrera
Дата:
От: John McCawley
Дата:
FAQ