Re: BUG #18274: Error 'invalid XML content'

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18274: Error 'invalid XML content'
Date: 2024-01-16 23:59:26
Message-ID: ZacYXgM9A_CSLpD8@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jan 16, 2024 at 04:55:34PM +0300, Dmitry Koval wrote:
>> - Document in a comment why a fake root node is necessary (aka the
>> current routines don't give enough control over the limits you'd
>> like to enforce).
>
> Comment expanded (see src/backend/utils/adt/xml.c).
>
>> - The top comment of xml_parse() still mentions
>> xmlParseBalancedChunkMemory() as an effect of 483bdb2afec9, so this
>> needs to be updated.
>
> Updated.

I still need to evaluate a bit more this part, though that looks fine.

>> Also, it may be worth double-checking if there are other things marked
>> as deprecated in the upstream doc, and switch to "newer" things.
>
> I found another deprecated function xmlSubstituteEntitiesDefault [1]
> (contrib/xml2). xmlSubstituteEntitiesDefault was removed and added the
> XML_PARSE_NOENT flag in functions xmlReadMemory instead it.

This one had better be done first because it is required by your
original issue, and that's what could make the buildfarm shaky.

I have checked the other XML calls in the tree and did not spot
anything else that ought to be changed, so I have extracted this stuff
from your v2 and applied it on HEAD. Let's see how it goes.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Yang Zhu 2024-01-17 06:07:54 Re: BUG #18283: vacuum full use a large amount of memory (may cause OOM)
Previous Message Yongtao Huang 2024-01-16 21:16:26 Fix a typo of func DecodeInsert()