Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 5425df8

Browse files
committed
Merge commit '3b1742b8391e966be780bdc43fdf959f7b3a118c'
2 parents eb4f611 + 3b1742b commit 5425df8

13 files changed

Lines changed: 101 additions & 14 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ if(LIBXML2_WITH_TESTS)
528528
endif()
529529
add_test(NAME testchar COMMAND testchar)
530530
add_test(NAME testdict COMMAND testdict)
531-
add_test(NAME testparser COMMAND testparser)
531+
add_test(NAME testparser COMMAND testparser WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
532532
add_test(NAME testrecurse COMMAND testrecurse WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
533533
add_test(NAME testThreads COMMAND testThreads WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
534534
endif()

NEWS

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
NEWS file for libxml2
22

3+
v2.13.3: Jul 24 2024
4+
5+
### Security
6+
7+
- [CVE-2024-40896] Fix XXE protection in downstream code
8+
9+
### Regressions
10+
11+
- autotools: Use AC_CHECK_DECL to check for getentropy
12+
- xinclude: Fix fallback for text includes
13+
- io: Don't call getcwd in xmlParserGetDirectory
14+
- io: Fix return value of xmlFileRead
15+
- parser: Fix error return of xmlParseBalancedChunkMemory
16+
17+
### Improvements
18+
19+
- xinclude: Set error handler when parsing text
20+
- Undeprecate xmlKeepBlanksDefault
21+
22+
323
v2.13.2: Jul 4 2024
424

525
### Regressions

configure.ac

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_PREREQ([2.63])
33

44
m4_define([MAJOR_VERSION], 2)
55
m4_define([MINOR_VERSION], 13)
6-
m4_define([MICRO_VERSION], 2)
6+
m4_define([MICRO_VERSION], 3)
77

88
AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
99
AC_CONFIG_SRCDIR([entities.c])
@@ -310,13 +310,17 @@ AC_CHECK_HEADERS([glob.h])
310310
AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_header_glob_h" = "yes")
311311

312312
dnl Checks for library functions.
313-
AC_CHECK_FUNCS([getentropy gettimeofday ftime stat mmap munmap])
313+
AC_CHECK_FUNCS([gettimeofday ftime stat mmap munmap])
314314

315315
AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */
316316
#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
317317
# undef /**/ HAVE_MMAP
318318
#endif])
319319

320+
AC_CHECK_DECL([getentropy],
321+
[AC_DEFINE([HAVE_GETENTROPY], [1], [getentropy])], [],
322+
[#include <sys/random.h>])
323+
320324
dnl
321325
dnl Checks for inet libraries
322326
dnl

include/libxml/parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ XML_DEPRECATED XMLPUBFUN int
948948
xmlSubstituteEntitiesDefault(int val);
949949
XML_DEPRECATED XMLPUBFUN int
950950
xmlThrDefSubstituteEntitiesDefaultValue(int v);
951-
XML_DEPRECATED XMLPUBFUN int
951+
XMLPUBFUN int
952952
xmlKeepBlanksDefault (int val);
953953
XML_DEPRECATED XMLPUBFUN int
954954
xmlThrDefKeepBlanksDefaultValue(int v);

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(
22
'libxml2',
33
'c',
4-
version: '2.13.2',
4+
version: '2.13.3',
55
license: 'MIT',
66
default_options: ['buildtype=debug', 'warning_level=3'],
77
meson_version: '>= 0.61',

parser.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7382,6 +7382,14 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
73827382
return;
73837383
}
73847384

7385+
/*
7386+
* Some users try to parse entities on their own and used to set
7387+
* the renamed "checked" member. Fix the flags to cover this
7388+
* case.
7389+
*/
7390+
if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
7391+
ent->flags |= XML_ENT_PARSED;
7392+
73857393
/*
73867394
* The first reference to the entity trigger a parsing phase
73877395
* where the ent->children is filled with the result from
@@ -12535,7 +12543,10 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
1253512543
else
1253612544
xmlFreeNodeList(list);
1253712545

12538-
ret = ctxt->errNo;
12546+
if (!ctxt->wellFormed)
12547+
ret = ctxt->errNo;
12548+
else
12549+
ret = XML_ERR_OK;
1253912550

1254012551
xmlFreeInputStream(input);
1254112552
xmlFreeParserCtxt(ctxt);

result/XInclude/fallback8.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0"?>
2+
<doc>
3+
text not found
4+
</doc>

result/XInclude/fallback8.xml.err

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
I/O warning : failed to load "test/XInclude/docs/404.txt": No such file or directory

result/XInclude/fallback8.xml.rdr

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
0 1 doc 0 0
2+
1 14 #text 0 1
3+
4+
1 3 #text 0 1 text not found
5+
1 14 #text 0 1
6+
7+
0 15 doc 0 0

test/XInclude/docs/fallback8.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<doc>
3+
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="404.txt" parse="text">
4+
<xi:fallback>text not found</xi:fallback>
5+
</xi:include>
6+
</doc>
7+

0 commit comments

Comments
 (0)