Re: Support json_errdetail in FRONTEND builds
| От | Daniel Gustafsson |
|---|---|
| Тема | Re: Support json_errdetail in FRONTEND builds |
| Дата | |
| Msg-id | CA5E9481-D63A-41BF-B4A5-88046A6195E0@yesql.se обсуждение исходный текст |
| Ответ на | Re: Support json_errdetail in FRONTEND builds (Michael Paquier <michael@paquier.xyz>) |
| Ответы |
Re: Support json_errdetail in FRONTEND builds
|
| Список | pgsql-hackers |
> On 15 Mar 2024, at 01:10, Michael Paquier <michael@paquier.xyz> wrote: > > On Thu, Mar 14, 2024 at 10:56:46AM +0100, Daniel Gustafsson wrote: >> + /* don't allow destroys of read-only StringInfos */ >> + Assert(str->maxlen != 0); >> Considering that StringInfo.c don't own the memory here I think it's warranted >> to turn this assert into an elog() to avoid the risk of use-after-free bugs. > > Hmm. I am not sure how much protection this would offer, TBH. I can't see how refusing to free memory owned and controlled by someone else, and throwing an error if attempted, wouldn't be a sound defensive programming measure. -- Daniel Gustafsson
В списке pgsql-hackers по дате отправления: