You have true. When I modify code on long ma = ((*saved_chars + l + VARHDRSZ) / page_size + 1) * page_size; *allocated_free = ma - *saved_chars - VARHDRSZ;
my function works well. Thank you wery much. One night I lost with this :-> On Tue, 12 Nov 2002, Tom Lane wrote: > Pavel Stehule <[EMAIL PROTECTED]> writes: > > I found some problem with PG_RETURN_TEXT_P. > > Fix your code to not scribble on memory that doesn't belong to it, > and all will be well. I can see at least two buffer-overrun bugs, > and there may be more: > > txtn = (text *) palloc (ma); -- forgot to add VARHDRSZ > > strcpy (*str_pointer, str); -- copies one byte too many > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] > ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
