Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uZBY2-00HMKx-VI for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Jul 2025 16:52:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uZBY1-00A7hb-1I for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Jul 2025 16:52:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uZBY0-00A7hQ-PN for pgsql-bugs@lists.postgresql.org; Tue, 08 Jul 2025 16:52:01 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZBXy-006U99-2z for pgsql-bugs@lists.postgresql.org; Tue, 08 Jul 2025 16:52:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 568Gpuap882828; Tue, 8 Jul 2025 12:51:57 -0400 From: Tom Lane To: d.kovalenko@postgrespro.ru cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18981: Fault tolerance and improvement for xmltotext_with_options (xml.c) In-reply-to: <18981-9bc3c80f107ae925@postgresql.org> References: <18981-9bc3c80f107ae925@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 08 Jul 2025 09:26:21 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <882826.1751993516.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 08 Jul 2025 12:51:56 -0400 Message-ID: <882827.1751993516@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Please look at this code: > https://github.com/postgres/postgres/blob/a27893df45ec5d8c657899202e9cf0= b9a816fe2f/src/backend/utils/adt/xml.c#L730 > xmlerrcxt =3D pg_xml_init(PG_XML_STRICTNESS_ALL); > pg_xml_init uses palloc and may "raise an exception". Yup, we should cover that case. > Also > Within PG_CATCH 'doc' is not NULL. Agreed. Pushed your fix with small editorialization. regards, tom lane