From nobody Sat Oct 10 06:45:14 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j1vP70lsJz6k2ZP for ; Sat, 10 Oct 2026 06:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j1vP70KMkz3Pf0 for ; Sat, 10 Oct 2026 06:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791614715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uOBUsv0WtPodc2qr8MNyye4x/impEdISR00lfPg0BY=; b=CpuSyRykFLNRastA1lxcstNKYbt2PK99g2ZdIeKhMO1TW02PqGF/TVYinfhYHh0/3g23VY EyToKBFIBI1qxdsiyyYv7FyZDAaBQ1sn3Zgr67/qbO23K1UoSalajBqpGKbb34h1dQySqe 6bDkD2Dx43B1XrLsABnFPFmiEFpicgBmLUoaccSdbPUCqxdkDozgo/K++CbP9PtjXlm1kB Ce5L5lakyjIhqnnn55knH96GjGpeUYcWSat910OwBC6l9GRFCchGdRy6ErxG0eJn3b56tr Qr+G6A0eGVkSfouQnhjItz6+9mopHGCkUF5yzviVlbkzO4ta04AeMLOd/Yn1FQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791614715; b=TBkZTqNflbzzCly4DtlGG8Lpnu4kMapjQyDKk/B4JhDwJBNBPPKv25U6qHzqR0RqbhxXVO NVFPZpwsNcaen0CmZiYspdgsWcIMDhbY1escFy7CqyfSlV/bGxhGBghrT3SI1Oxpr41IrX TOha2EDf3Z3FS0gcuj3A0I/RhpvvSwxrfkKGBdG8YyA/XE9/Jsg2v1AUuF+CoToWJrkH3G 4q1cvlHl0EP9WH+fZn3ALUJEIzH1LLPS26wmFqsX6f1tS732LnF9w2hci3oZqkaRz4rojb ONJsC5JTontdZlzNHy5Qkno0Xqy7e5PGcR3DwRMF4ET95tuk2XpWcIIwAwWDng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791614715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uOBUsv0WtPodc2qr8MNyye4x/impEdISR00lfPg0BY=; b=H7OQGUQPc9erY9GF5+AuNav4LsydfQr5hep1PLFof8kNhgrXk1QgdADpWsVn72YDZ3+5hw BjNuRdz4goWOZonvsJpvceKvTodOUMRqyHX+xF9V7dFQwSLvYqYXw/9iPonp1RCRllgCdb 876N+a4RB1apYamBz9cLHmHnB3n3R18rxXoTgpaUZvmVLjBui61vm8a2TCPfYGKoFmibpV NDVWLp0as+n7z+tTfTTOKCcW/ETipGF8tb8MLKOgvE/Pg55/57NFCVfYA6B2CiAENgLCaM GlWLaLvyABosZVo3vUXh3m7xYI9ib0WXELdErKqdCuPj3KcHGSV3xvyFqneBZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j1vP65qn2zmJY for ; Sat, 10 Oct 2026 06:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30816 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 10 Oct 2026 06:45:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 94fd9b50590d - stable/15 - contrib/expat: import expat 2.9.0 List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 94fd9b50590d114164755e7e6909334fe69c4e98 Auto-Submitted: auto-generated Date: Sat, 10 Oct 2026 06:45:14 +0000 Message-Id: <6ac9defa.30816.412e36c@gitrepo.freebsd.org> The branch stable/15 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=94fd9b50590d114164755e7e6909334fe69c4e98 commit 94fd9b50590d114164755e7e6909334fe69c4e98 Author: Philip Paeps AuthorDate: 2026-10-06 07:05:31 +0000 Commit: Philip Paeps CommitDate: 2026-10-10 02:43:40 +0000 contrib/expat: import expat 2.9.0 Changes: https://github.com/libexpat/libexpat/blob/R_2_9_0/expat/Changes Security: CVE-2026-102633 Security: CVE-2026-77214 (cherry picked from commit 22c3edb31297a79ec3c7bf8f906be2df11b472d2) --- contrib/expat/Changes | 128 ++++- contrib/expat/Makefile.in | 3 - contrib/expat/README.md | 2 +- contrib/expat/configure.ac | 27 +- contrib/expat/doc/Makefile.in | 3 - contrib/expat/doc/reference.html | 754 +++++++++++++++++++++--- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/examples/Makefile.in | 3 - contrib/expat/examples/element_declarations.c | 14 +- contrib/expat/examples/elements.c | 14 +- contrib/expat/examples/outline.c | 14 +- contrib/expat/expat_config.h.in | 4 - contrib/expat/fuzz/xml_parse_fuzzer.c | 2 +- contrib/expat/fuzz/xml_parsebuffer_fuzzer.c | 2 +- contrib/expat/lib/Makefile.am | 3 +- contrib/expat/lib/Makefile.in | 43 +- contrib/expat/lib/expat.h | 99 +++- contrib/expat/lib/expat_external.h | 3 + contrib/expat/lib/internal.h | 12 +- contrib/expat/lib/libexpat.map.in | 17 +- contrib/expat/lib/xcs.c | 90 +++ contrib/expat/lib/{xcsinc.c => xcs.h} | 36 +- contrib/expat/lib/xmlparse.c | 549 +++++++++++++----- contrib/expat/lib/xmltok.c | 280 ++------- contrib/expat/lib/xmltok_impl.c | 2 +- contrib/expat/tests/Makefile.am | 6 +- contrib/expat/tests/Makefile.in | 23 +- contrib/expat/tests/acc_tests.c | 37 ++ contrib/expat/tests/alloc_tests.c | 59 ++ contrib/expat/tests/basic_tests.c | 170 ++++-- contrib/expat/tests/benchmark/Makefile.in | 3 - contrib/expat/tests/benchmark/benchmark.c | 19 +- contrib/expat/tests/chardata.c | 4 +- contrib/expat/tests/common.c | 11 +- contrib/expat/tests/common.h | 6 - contrib/expat/tests/handlers.c | 115 ++-- contrib/expat/tests/misc_tests.c | 114 +++- contrib/expat/tests/props_tests.c | 790 ++++++++++++++++++++++++++ contrib/expat/tests/props_tests.h | 41 ++ contrib/expat/tests/runtests.c | 20 +- contrib/expat/tests/structdata.c | 11 +- contrib/expat/tests/xcs_tests.c | 86 +++ contrib/expat/tests/xcs_tests.h | 41 ++ contrib/expat/xmlwf/Makefile.am | 3 +- contrib/expat/xmlwf/Makefile.in | 46 +- contrib/expat/xmlwf/xmlfile.c | 9 +- contrib/expat/xmlwf/xmlfile.h | 8 +- contrib/expat/xmlwf/xmlwf.c | 31 +- lib/libexpat/Makefile | 2 +- lib/libexpat/expat_config.h | 6 +- lib/libexpat/libbsdxml.3 | 4 +- 52 files changed, 2945 insertions(+), 828 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index bf94e9db5616..91513379bb49 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -5,21 +5,108 @@ \___/_/\_\ .__/ \__,_|\__| |_| XML parser -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! Expat has UNFIXED SECURITY ISSUES! !! -!! Please see https://github.com/libexpat/libexpat/issues/1160 for details. !! -!! !! -!! Starting 2026-08-01, for up to six months my work maintaining libexpat !! -!! will be funded by the City of Munich as part of their !! -!! Open Source Sabbatical (https://opensource.muenchen.de/sabbatical.html) !! -!! — thank you! !! -!! !! -!! If your business relies on Expat beyond January 2027, please consider !! -!! funding the maintenance of Expat to ensure its health and security for !! -!! you and others. Thank you! !! -!! !! -!! Sebastian Pipping -- Berlin, 2026-09-22 !! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +/////////////////////////////////////////////////////////////////////////////// +// Expat has UNFIXED SECURITY ISSUES! // +// Please see https://github.com/libexpat/libexpat/issues/1160 for details. // +// // +// Starting 2026-08-01, for up to six months my work maintaining libexpat // +// will be funded by the City of Munich as part of their // +// Open Source Sabbatical (https://opensource.muenchen.de/sabbatical.html) // +// — thank you! // +// // +// If your business relies on Expat beyond January 2027, please consider // +// funding the maintenance of Expat to ensure its health and security for // +// you and others. Thank you! // +// // +// Sebastian Pipping -- Berlin, 2026-09-22 // +/////////////////////////////////////////////////////////////////////////////// + +Release 2.9.0 Mon October 5 2026 + Security fixes: + #1392 CVE-2026-102633 -- Integer overflow in function + expat_realloc on 32bit platforms + #1393 CVE-2026-77214 -- Validate parameter `len` against available + buffer capacity in XML_ParseBuffer + + Bug fixes: + #1387 lib: Handle OOM when copying encodingName in XML_ParserReset + + New features: + #1327 lib: Introduce new "Properties API" to get and set + scalar properties for a single parser instance. + There are six new functions: + - XML_GetPropertyBool + - XML_GetPropertyDouble + - XML_GetPropertyUInt64 + - XML_SetPropertyBool + - XML_SetPropertyDouble + - XML_SetPropertyUInt64 + And two new enums: + - XML_Prop_Error + - XML_Parser_Property + #1323 lib: Introduce five new 64bit location API functions: + - XML_GetCurrentByteCount64 + - XML_GetCurrentByteIndex64 + - XML_GetCurrentColumnNumber64 + - XML_GetCurrentLineNumber64 + - XML_GetInputContext64 + These five functions closely mirror their predecessors + but are not prone to 32bit integer wrap-around. + + Other changes: + #1391 docs: Document the scope of function XML_GetErrorCode + #1395 docs: Document length expectations for XML_ParseBuffer + #1394 lib: Call unknown encoding release before parser teardown + #1370 #1373 lib: Drop (disabled-by-default) attribute info feature + These things are now gone: + - Public function XML_GetAttributeInfo + - Public struct XML_AttrInfo + - Macro XML_ATTR_INFO + These things are now causing build errors: + - Configure option --enable-xml-attr-info + - CMake option -DEXPAT_ATTR_INFO=ON + #1379 #1382 lib: Drop (disabled-by-default) minimum size feature + These things are now gone: + - Macro XML_MIN_SIZE + These things are now causing build errors: + - Configuring with -DXML_MIN_SIZE for CPPFLAGS/CFLAGS + - CMake option -DEXPAT_MIN_SIZE=ON + #1323 #1411 lib: Deprecate macro XML_LARGE_SIZE (use the new 64bit + location API functions instead please) + #1323 lib: Deprecate five location API functions that are cursed + with integer wrap-around: + - XML_GetCurrentByteCount + - XML_GetCurrentByteIndex + - XML_GetCurrentColumnNumber + - XML_GetCurrentLineNumber + - XML_GetInputContext + #1399 lib: Guard against out-of-handler use of XML_DefaultCurrent + #1400 lib: Use size_t for bytesAllocated and peakBytesAllocated + #1401 #1402 .. + #1404 #1405 lib|xmlwf|tests: Unify use of xcslen, xcscmp and xcsncmp + #1406 xmlwf: Add missing `#include "expat.h"` + #1389 #1396 Version info bumped from 13:5:12 (libexpat*.so.1.12.5) + to 14:0:13 (libexpat*.so.1.13.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #1386 CI: Bump MinGW Clang from 23.1.1 to 23.1.2 + #1410 CI: Bump Fil-C from 0.685 to 0.686 + #1388 CI: Adapt to breaking changes regarding windows-11-arm image + #1403 CI: Limit package cache download runtime + + Special thanks to: + Bénédikt Tran + Berkay Eren Ürün + Fabian Wahle (Hap Security) + Filippo Tedeschi + Junki Lee + Matthew Fernandez + Scott Moore + Wade Sparks III + and + City of Munich Open Source Sabbatical + VulnCheck Release 2.8.5 Tue September 22 2026 Security fixes: @@ -33,17 +120,6 @@ Release 2.8.5 Tue September 22 2026 Upstream CVSS 3.1 vector: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (CVSS score: 9.8) -/////////////////////////////////////////////////////////////////////////////// -// The next release will drop two (disabled-by-default) features: // -// // -// - ATTR_INFO (-DXML_ATTR_INFO, -DEXPAT_ATTR_INFO, --enable-xml-attr-info, // -// function XML_GetAttributeInfo, struct XML_AttrInfo) // -// - MIN_SIZE (-DXML_MIN_SIZE, -DEXPAT_MIN_SIZE) // -// // -// If you need them in 2026 and beyond, please share your scenario at // -// GitHub issues #1370 (for ATTR_INFO) and/or #1379 (for MIN_SIZE). Thanks! // -/////////////////////////////////////////////////////////////////////////////// - Bug fixes: #1346 lib: Fix OOM-related memory leak on a failed overflow check #1371 lib: Fix memory alignment for architectures with 128bit diff --git a/contrib/expat/Makefile.in b/contrib/expat/Makefile.in index c0a0eefc47ac..999ed2b231dc 100644 --- a/contrib/expat/Makefile.in +++ b/contrib/expat/Makefile.in @@ -345,12 +345,10 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ -EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@ EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@ EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@ EXPAT_DTD = @EXPAT_DTD@ EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@ -EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@ EXPAT_NS = @EXPAT_NS@ FGREP = @FGREP@ FILECMD = @FILECMD@ @@ -405,7 +403,6 @@ SO_PATCH = @SO_PATCH@ STRIP = @STRIP@ VERSION = @VERSION@ VSCRIPT_LDFLAGS = @VSCRIPT_LDFLAGS@ -_EXPAT_COMMENT_ATTR_INFO = @_EXPAT_COMMENT_ATTR_INFO@ _EXPAT_COMMENT_DTD_OR_GE = @_EXPAT_COMMENT_DTD_OR_GE@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ diff --git a/contrib/expat/README.md b/contrib/expat/README.md index 36e46a90fd23..1951645e8285 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -17,7 +17,7 @@ > Thank you! :heart: :pray: -# Expat, Release 2.8.5 +# Expat, Release 2.9.0 This is Expat, a C99 library for parsing [XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index e8562dbc5fc1..6d80021cf0a9 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -103,9 +103,9 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=13 # sync -LIBREVISION=5 # with -LIBAGE=12 # CMakeLists.txt! +LIBCURRENT=14 # sync +LIBREVISION=0 # with +LIBAGE=13 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) AH_TOP([#ifndef EXPAT_CONFIG_H @@ -226,9 +226,11 @@ AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes]) dnl Note: Prefix "_INTERNAL_" here means exclusive use inside of file configure.ac AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null]) AM_CONDITIONAL([_INTERNAL_UNICODE_WCHAR_T], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null]) -AM_CONDITIONAL([_INTERNAL_MIN_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null]) AM_CONDITIONAL([_INTERNAL_LARGE_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null]) +AS_IF([echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null], + [AC_MSG_ERROR([Feature XML_MIN_SIZE has been removed. Please open a GitHub issue if you need it back.])]) + LT_LIB_M AC_ARG_WITH([arc4random], @@ -428,13 +430,11 @@ AS_IF([test "x${with_dev_urandom}" = "xyes"], AC_ARG_ENABLE([xml-attr-info], - [AS_HELP_STRING([--enable-xml-attr-info], - [Enable retrieving the byte offsets for attribute names and values @<:@default=no@:>@])], + [], [], [enable_xml_attr_info=no]) AS_IF([test "x${enable_xml_attr_info}" = "xyes"], - [AC_DEFINE([XML_ATTR_INFO], 1, - [Define to allow retrieving the byte offsets for attribute names and values.])]) + [AC_MSG_ERROR([Feature --enable-xml-attr-info has been removed. Please open a GitHub issue if you need it back.])]) AC_ARG_ENABLE([xml-context], AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@], @@ -495,21 +495,12 @@ dnl Configure CMake file templates dnl NOTE: The *_TRUE variables read here are Automake conditionals dnl that are either set to "" when enabled or to "#" when disabled dnl (because they are used to dynamically comment out certain things) -AS_IF([test "x${enable_xml_attr_info}" = xyes], - [EXPAT_ATTR_INFO=ON - _EXPAT_COMMENT_ATTR_INFO=" "], - [EXPAT_ATTR_INFO=OFF - _EXPAT_COMMENT_ATTR_INFO="#"]) -AC_SUBST([_EXPAT_COMMENT_ATTR_INFO]) EXPAT_DTD=ON _EXPAT_COMMENT_DTD_OR_GE=" " AC_SUBST([_EXPAT_COMMENT_DTD_OR_GE]) AS_IF([test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x], [EXPAT_LARGE_SIZE=ON], [EXPAT_LARGE_SIZE=OFF]) -AS_IF([test "x${_INTERNAL_MIN_SIZE_TRUE}" = x], - [EXPAT_MIN_SIZE=ON], - [EXPAT_MIN_SIZE=OFF]) EXPAT_NS=ON AS_IF([test "x${enable_xml_context}" != xno], [EXPAT_CONTEXT_BYTES=${enable_xml_context}], @@ -525,10 +516,8 @@ LIBDIR_BASENAME="$(basename "${libdir}")" SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")" SO_MINOR="${LIBAGE}" SO_PATCH="${LIBREVISION}" -AC_SUBST([EXPAT_ATTR_INFO]) AC_SUBST([EXPAT_DTD]) AC_SUBST([EXPAT_LARGE_SIZE]) -AC_SUBST([EXPAT_MIN_SIZE]) AC_SUBST([EXPAT_NS]) AC_SUBST([EXPAT_CONTEXT_BYTES]) AC_SUBST([EXPAT_CHAR_TYPE]) diff --git a/contrib/expat/doc/Makefile.in b/contrib/expat/doc/Makefile.in index 52a18ffb673f..afe0b8d5c814 100644 --- a/contrib/expat/doc/Makefile.in +++ b/contrib/expat/doc/Makefile.in @@ -234,12 +234,10 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ -EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@ EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@ EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@ EXPAT_DTD = @EXPAT_DTD@ EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@ -EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@ EXPAT_NS = @EXPAT_NS@ FGREP = @FGREP@ FILECMD = @FILECMD@ @@ -294,7 +292,6 @@ SO_PATCH = @SO_PATCH@ STRIP = @STRIP@ VERSION = @VERSION@ VSCRIPT_LDFLAGS = @VSCRIPT_LDFLAGS@ -_EXPAT_COMMENT_ATTR_INFO = @_EXPAT_COMMENT_ATTR_INFO@ _EXPAT_COMMENT_DTD_OR_GE = @_EXPAT_COMMENT_DTD_OR_GE@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 5bd9150ea78a..2f892fd20b82 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -53,7 +53,7 @@

- The Expat XML Parser Release 2.8.5 + The Expat XML Parser Release 2.9.0

@@ -309,22 +309,76 @@
  • XML_GetCurrentByteIndex + (deprecated) +
  • + +
  • + XML_GetCurrentByteIndex64
  • XML_GetCurrentLineNumber + (deprecated) +
  • + +
  • + XML_GetCurrentLineNumber64
  • XML_GetCurrentColumnNumber + (deprecated) +
  • + +
  • + XML_GetCurrentColumnNumber64
  • XML_GetCurrentByteCount + (deprecated) +
  • + +
  • + XML_GetCurrentByteCount64
  • - XML_GetInputContext + XML_GetInputContext (deprecated) +
  • + +
  • + XML_GetInputContext64 +
  • + + + +
  • + Properties / Security Tuning +
  • @@ -391,10 +445,6 @@ XML_GetIdAttributeIndex -
  • - XML_GetAttributeInfo -
  • -
  • XML_SetEncoding
  • @@ -751,19 +801,59 @@ make install
    - XML_LARGE_SIZE + XML_LARGE_SIZE (deprecated)
    - If defined, causes the XML_Size and XML_Index integer - types to be at least 64 bits in size. This is intended to support processing of - very large input streams, where the return values of XML_GetCurrentByteIndex, XML_GetCurrentLineNumber and - XML_GetCurrentColumnNumber could - overflow. It may not be supported by all compilers, and is turned off by - default. +

    + If defined, causes the XML_Size and XML_Index + integer types to be at least 64 bits in size. This is intended to support + processing of very large input streams, where the return values of + XML_GetCurrentByteIndex, + XML_GetCurrentLineNumber + and XML_GetCurrentColumnNumber could + overflow. It may not be supported by all compilers, and is turned off by + default. +

    + +

    + Starting with Expat 2.9.0, there are 64bit versions of these functions, so + that relying on (non-default and uncommon) macro XML_LARGE_SIZE + is no longer needed. These functions are: +

    + + + +

    + And there are two more that XML_LARGE_SIZE was not covering: +

    + +
    @@ -790,16 +880,6 @@ make install the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms. - -
    - XML_ATTR_INFO -
    - -
    - If defined, makes the additional function XML_GetAttributeInfo available for reporting - attribute byte offsets. -

    @@ -1707,6 +1787,17 @@ XML_ParseBuffer(XML_Parser p, application can avoid double copying of the input.

    +

    + Note: It is the responsibility of the application code to pass + a value for len that does not exceed the length of the remaining + unparsed XML content that was previously copied into the buffer obtained from + XML_GetBuffer. The documentation of + XML_GetBuffer below has an example of typical use of functions XML_GetBuffer and XML_ParseBuffer in tandem. +

    +

    Negative values for len are rejected since Expat 2.6.3.

    @@ -2889,7 +2980,40 @@ enum XML_Error XMLCALL XML_GetErrorCode(XML_Parser p);
    - Return what type of error has occurred. +

    + Return what type of error has occurred inside the main Expat parsing machinery. +

    + +

    + Only the following functions record the type of error for retrivial via + XML_GetErrorCode: +

    + +

    @@ -2907,13 +3031,18 @@ XML_ErrorString(enum XML_Error code);

    - XML_GetCurrentByteIndex + XML_GetCurrentByteIndex (deprecated)

     XML_Index XMLCALL
     XML_GetCurrentByteIndex(XML_Parser p);
     
    +

    + Note: This function is deprecated, please use function XML_GetCurrentByteIndex64, instead. +

    +
    Return the byte offset of the position. This always corresponds to the values returned by XML_LARGE_SIZE.

    +

    + XML_GetCurrentByteIndex64 +

    + +
    +/* Added in Expat 2.9.0. */
    +int64_t XMLCALL
    +XML_GetCurrentByteIndex64(XML_Parser p);
    +
    +
    + Return the byte offset of the position. This always corresponds to the values + returned by XML_GetCurrentLineNumber64 and + XML_GetCurrentColumnNumber64. +
    +

    - XML_GetCurrentLineNumber + XML_GetCurrentLineNumber (deprecated)

     XML_Size XMLCALL
     XML_GetCurrentLineNumber(XML_Parser p);
     
    +

    + Note: This function is deprecated, please use function XML_GetCurrentLineNumber64, instead. +

    +
    Return the line number of the position. The first line is reported as 1. @@ -2948,14 +3099,33 @@ XML_GetCurrentLineNumber(XML_Parser p); "#XML_LARGE_SIZE">XML_LARGE_SIZE.

    +

    + XML_GetCurrentLineNumber64 +

    + +
    +/* Added in Expat 2.9.0. */
    +uint64_t XMLCALL
    +XML_GetCurrentLineNumber64(XML_Parser p);
    +
    +
    + Return the line number of the position. The first line is reported as + 1. +
    +

    - XML_GetCurrentColumnNumber + XML_GetCurrentColumnNumber (deprecated)

     XML_Size XMLCALL
     XML_GetCurrentColumnNumber(XML_Parser p);
     
    +

    + Note: This function is deprecated, please use function XML_GetCurrentColumnNumber64, instead. +

    +
    Return the offset, from the beginning of the current line, of the position. The first column is reported as 0. @@ -2968,13 +3138,53 @@ XML_GetCurrentColumnNumber(XML_Parser p); "#XML_LARGE_SIZE">XML_LARGE_SIZE.

    +

    + XML_GetCurrentColumnNumber64 +

    + +
    +/* Added in Expat 2.9.0. */
    +uint64_t XMLCALL
    +XML_GetCurrentColumnNumber64(XML_Parser p);
    +
    +
    + Return the offset, from the beginning of the current line, of the + position. The first column is reported as 0. +
    +

    - XML_GetCurrentByteCount + XML_GetCurrentByteCount (deprecated)

     int XMLCALL
     XML_GetCurrentByteCount(XML_Parser p);
    +
    +

    + Note: This function is deprecated, please use function XML_GetCurrentByteCount64, instead. +

    + +
    + Return the number of bytes in the current event. Returns 0 if the + event is inside a reference to an internal entity and for the end-tag event for + empty element tags (the later can be used to distinguish empty-element tags from + empty elements using separate start and end tags). +
    + +

    + Note: Type int is known to wrap around (on both + 32bit platforms and 64bit platforms). +

    + +

    + XML_GetCurrentByteCount64 +

    + +
    +/* Added in Expat 2.9.0. */
    +uint64_t XMLCALL
    +XML_GetCurrentByteCount64(XML_Parser p);
     
    Return the number of bytes in the current event. Returns 0 if the @@ -2984,7 +3194,7 @@ XML_GetCurrentByteCount(XML_Parser p);

    - XML_GetInputContext + XML_GetInputContext (deprecated)

    @@ -2992,6 +3202,53 @@ const char * XMLCALL
     XML_GetInputContext(XML_Parser p,
                         int *offset,
                         int *size);
    +
    +

    + Note: This function is deprecated, please use function XML_GetInputContext64, instead. +

    + +
    +

    + Returns the parser's input buffer, sets the integer pointed at by + offset to the offset within this buffer of the current parse + position, and set the integer pointed at by size to the size of + the returned buffer. +

    + +

    + This should only be called from within a handler during an active parse and the + returned buffer should only be referred to from within the handler that made + the call. This input buffer contains the untranslated bytes of the input. +

    + +

    + Only a limited amount of context is kept, so if the event triggering a call + spans over a very large amount of input, the actual parse position may be + before the beginning of the buffer. +

    + +

    + If XML_CONTEXT_BYTES is zero, this will always return + NULL. +

    + +

    + Note: Type int is known to wrap around (on both + 32bit platforms and 64bit platforms). +

    +
    + +

    + XML_GetInputContext64 +

    + +
    +/* Added in Expat 2.9.0. */
    +const char * XMLCALL
    +XML_GetInputContext64(XML_Parser p,
    +                    int64_t *offset,
    +                    zint64_t *size);
     

    @@ -3019,11 +3276,390 @@ XML_GetInputContext(XML_Parser p,

    +

    + Properties / Security Tuning +

    + +

    + Expat 2.9.0 introduced a new Properties API. Think of properties as the control + knobs of a parser. The key motivations behind its introduction are: +

    + +
      +
    • to allow Expat to add more properties — both security-related and non- + security ones — in the future (without need to also add new related getter and + setter functions for each of them as was the case in the past), +
    • + +
    • to allow users to read (not just to set) the current values, and +
    • + +
    • to allow users to distinuish the different sources of error beyond a mere + "did not work". +
    • +
    + +

    + There is one setter function and one getter function — a pair — per supported + data type: +

    + + + +

    + They all share these two key enums: +

    + +

    + XML_Parser_Property +

    + +
    +/* Added in Expat 2.9.0. */
    +enum XML_Parser_Property {
    +#  if XML_GE == 1
    +  XML_PROP_ALLOC_TRACKER_ACTIVATION_THRESHOLD = 1,   // of type `uint64_t`
    +  XML_PROP_ALLOC_TRACKER_MAXIMUM_AMPLIFICATION = 2,  // of type `double`
    +  XML_PROP_BILLION_LAUGHS_ACTIVATION_THRESHOLD = 3,  // of type `uint64_t`
    +  XML_PROP_BILLION_LAUGHS_MAXIMUM_AMPLIFICATION = 4, // of type `double`
    +#  endif
    +  XML_PROP_REPARSE_DEFERRAL_ENABLED = 5, // of type `XML_Bool`
    +  /* more properties upcoming here */
    +};
    +

    + XML_Prop_Error +

    + +
    +/* Added in 2.9.0. */
    +enum XML_Prop_Error {
    +  XML_PROP_ERROR_NONE = 0, // i.e. success
    +
    +  XML_PROP_ERROR_INVALID_KEY = 1,   // i.e. the property is not known at all
    +  XML_PROP_ERROR_INVALID_TYPE = 2,  // i.e. the property is known but expects a
    +                                    // different type (so a different
    +                                    // getter/setter would need to be called)
    +  XML_PROP_ERROR_INVALID_VALUE = 3, // i.e. the value is invalid (with a setter
    +                                    // function) or a NULL-pointer (with a
    +                                    // getter function)
    +
    +  XML_PROP_ERROR_PARSER_NULL = 4,     // i.e. the parser argument is NULL
    +  XML_PROP_ERROR_PARSER_NOT_ROOT = 5, // i.e. the parser is not a root parser
    +                                      // but a subparser (and a root parser is
    +                                      // needed)
    +
    +  /* potentially more error codes upcoming here */
    +};
    +

    + Let us look at these functions in more detail: +

    + +

    + XML_GetPropertyBool +

    + +
    +/* Added in Expat 2.9.0. */
    +enum XML_Prop_Error
    +XML_GetPropertyBool(XML_Parser parser, enum XML_Parser_Property property,
    +                    XML_Bool *value);
    +
    +
    +

    + Writes the current value of boolean property property of parser + parser to output variable value. Supported properties + are: +

    + +
      +
    • + XML_PROP_REPARSE_DEFERRAL_ENABLED — whether reparse deferral is active or not +
    • +
    + +

    + Both parameters parser and value must be + non-NULL. On success XML_PROP_ERROR_NONE is returned; + on error one of the other variants of XML_Prop_Error is returned. +

    + +

    + Note: There may be more error codes introduced into XML_Prop_Error in the future, so user code must be robust + towards error codes from the future at runtime that were not known at compile + time. +

    +
    + +

    + XML_GetPropertyDouble +

    + +
    +/* Added in Expat 2.9.0. */
    +enum XML_Prop_Error
    +XML_GetPropertyDouble(XML_Parser parser, enum XML_Parser_Property property,
    +                      double *value);
    *** 5122 LINES SKIPPED ***