Re: Question about Encoding a Custom Type

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Question about Encoding a Custom Type
Дата
Msg-id 20080616184158.GH4792@svana.org
обсуждение исходный текст
Ответ на Re: Question about Encoding a Custom Type  ("David E. Wheeler" <david@kineticode.com>)
Ответы Re: Question about Encoding a Custom Type
Список pgsql-hackers
On Mon, Jun 16, 2008 at 01:29:33PM -0500, David E. Wheeler wrote:
> >Smells like uninitialized-memory problems to me.  Perhaps you are
> >miscalculating the length of the input data?
>
> Entirely possible. Here are the two functions in which I calculate size:

Actually, real dumb question but: arn't you assume that text* values
are NULL terminated, because they're not...
>
> char * cilower(text * arg) {
>     // Do I need to free anything here?
>     char * str = VARDATA_ANY( arg );

str here is not null terminated. You need text_to_cstring or something
similar.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

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

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: How to Sponsor a Feature
Следующее
От: Robert Treat
Дата:
Сообщение: Re: Crash in pgCrypto?