Re: Buffer overflow in psql

Поиск
Список
Период
Сортировка
От John D. Burger
Тема Re: Buffer overflow in psql
Дата
Msg-id 45E917CE-ABCD-46A8-9707-F1CBCEC6305C@mitre.org
обсуждение исходный текст
Ответ на Re: Buffer overflow in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:

>> Um, is that really considered a fix???  We all know that there's no
>> guarantee at all, even in ANSI C, that unsigned int isn't bigger than
>> 32 bits, right?
>
> OID is 32 bits.  Full stop.

I should know better than to argue about this, but:

In that case, casting it as in the OP's code sample seems problematic
in the other direction:

   sprintf(buf, "%u", (unsigned int)PQoidValue(results));

since unsigned int could be as small as 16 bits, thus truncating the
OID value.

Ok, I'll stop now, I promise.

- John D. Burger
   MITRE

В списке pgsql-general по дате отправления:

Предыдущее
От: koppelp@mir.wustl.edu
Дата:
Сообщение: Re: kerberos authentication error with Windows 2003 SP1 AD
Следующее
От: "Jeffrey Webster"
Дата:
Сообщение: Re: PGDATA