From 2db233019f551fe4c701bbbc5eb0fa58ff349daa Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 25 Aug 2024 19:09:51 +0200 Subject: [PATCH] doc: Document that XML_Parse/XML_ParseBuffer reject "len < 0" CVE: CVE-2024-45490 Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/2db233019f551fe4c701bbbc5eb0fa58ff349daa] Signed-off-by: Archana Polampalli --- doc/reference.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/reference.html b/doc/reference.html index cdf3983..ebae824 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -1097,7 +1097,9 @@ containing part (or perhaps all) of the document. The number of bytes of s that are part of the document is indicated by len. This means that s doesn't have to be null terminated. It also means that if len is larger than the number of bytes in the block of -memory that s points at, then a memory fault is likely. The +memory that s points at, then a memory fault is likely. +Negative values for len are rejected since Expat 2.2.1. +The isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) @@ -1113,11 +1115,17 @@ XML_ParseBuffer(XML_Parser p, int isFinal);
+

This is just like XML_Parse, except in this case Expat provides the buffer. By obtaining the buffer from Expat with the XML_GetBuffer function, the application can avoid double copying of the input. +

+ +

+Negative values for len are rejected since Expat 2.6.3. +

XML_GetBuffer

-- 2.40.0