diff --git a/contrib/expat/COPYING b/contrib/expat/COPYING index 8d288f0f28fd..3c0142e71c8d 100644 --- a/contrib/expat/COPYING +++ b/contrib/expat/COPYING @@ -1,5 +1,5 @@ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001-2017 Expat maintainers +Copyright (c) 2001-2019 Expat maintainers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/contrib/expat/Changes b/contrib/expat/Changes index 340947118a3f..7540d38ca822 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -2,7 +2,283 @@ NOTE: We are looking for help with a few things: https://github.com/libexpat/libexpat/labels/help%20wanted If you can help, please get in touch. Thanks! -Release 2.2.9 Wed Septemper 25 2019 +Release 2.4.3 Sun January 16 2022 + Security fixes: + #531 #534 CVE-2021-45960 -- Fix issues with left shifts by >=29 places + resulting in + a) realloc acting as free + b) realloc allocating too few bytes + c) undefined behavior + depending on architecture and precise value + for XML documents with >=2^27+1 prefixed attributes + on a single XML tag a la + "" + where XML_ParserCreateNS is used to create the parser + (which needs argument "-n" when running xmlwf). + Impact is denial of service, or more. + #532 #538 CVE-2021-46143 (ZDI-CAN-16157) -- Fix integer overflow + on variable m_groupSize in function doProlog leading + to realloc acting as free. + Impact is denial of service or more. + #539 CVE-2022-22822 to CVE-2022-22827 -- Prevent integer overflows + near memory allocation at multiple places. Mitre assigned + a dedicated CVE for each involved internal C function: + - CVE-2022-22822 for function addBinding + - CVE-2022-22823 for function build_model + - CVE-2022-22824 for function defineAttribute + - CVE-2022-22825 for function lookup + - CVE-2022-22826 for function nextScaffoldPart + - CVE-2022-22827 for function storeAtts + Impact is denial of service or more. + + Other changes: + #535 CMake: Make call to file(GENERATE [..]) work for CMake <3.19 + #541 Autotools|CMake: MinGW: Make run.sh(.in) work for Cygwin + and MSYS2 by not going through Wine on these platforms + #527 #528 Address compiler warnings + #533 #543 Version info bumped from 9:2:8 to 9:3:8; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #536 CI: Check for realistic minimum CMake version + #529 #539 CI: Cover compilation with -m32 + #529 CI: Store coverage reports as artifacts for download + #528 CI: Upgrade Clang from 11 to 13 + + Special thanks to: + An anonymous whitehat + Christopher Degawa + J. Peter Mugaas + Tyson Smith + and + GCC Farm Project + Trend Micro Zero Day Initiative + +Release 2.4.2 Sun December 19 2021 + Other changes: + #509 #510 Link againgst libm for function "isnan" + #513 #514 Include expat_config.h as early as possible + #498 Autotools: Include files with release archives: + - buildconf.sh + - fuzz/*.c + #507 #519 Autotools: Sync CMake templates + #495 #524 CMake: MinGW: Fix pkg-config section "Libs" for + - non-release build types (e.g. -DCMAKE_BUILD_TYPE=Debug) + - multi-config CMake generators (e.g. Ninja Multi-Config) + #502 #503 docs: Document that function XML_GetBuffer may return NULL + when asking for a buffer of 0 (zero) bytes size + #522 #523 docs: Fix return value docs for both + XML_SetBillionLaughsAttackProtection* functions + #525 #526 Version info bumped from 9:1:8 to 9:2:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Dong-hee Na + Joergen Ibsen + Kai Pastor + +Release 2.4.1 Sun May 23 2021 + Bug fixes: + #488 #490 Autotools: Fix installed header expat_config.h for multilib + systems; regression introduced in 2.4.0 by pull request #486 + + Other changes: + #491 #492 Version info bumped from 9:0:8 to 9:1:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Gentoo's QA check "multilib_check_headers" + +Release 2.4.0 Sun May 23 2021 + Security fixes: + #34 #466 #484 CVE-2013-0340/CWE-776 -- Protect against billion laughs attacks + (denial-of-service; flavors targeting CPU time or RAM or both, + leveraging general entities or parameter entities or both) + by tracking and limiting the input amplification factor + ( := ( + ) / ). + By conservative default, amplification up to a factor of 100.0 + is tolerated and rejection only starts after 8 MiB of output bytes + (= + ) have been processed. + The fix adds the following to the API: + - A new error code XML_ERROR_AMPLIFICATION_LIMIT_BREACH to + signals this specific condition. + - Two new API functions .. + - XML_SetBillionLaughsAttackProtectionMaximumAmplification and + - XML_SetBillionLaughsAttackProtectionActivationThreshold + .. to further tighten billion laughs protection parameters + when desired. Please see file "doc/reference.html" for details. + If you ever need to increase the defaults for non-attack XML + payload, please file a bug report with libexpat. + - Two new XML_FEATURE_* constants .. + - that can be queried using the XML_GetFeatureList function, and + - that are shown in "xmlwf -v" output. + - Two new environment variable switches .. + - EXPAT_ACCOUNTING_DEBUG=(0|1|2|3) and + - EXPAT_ENTITY_DEBUG=(0|1) + .. for runtime debugging of accounting and entity processing. + Specific behavior of these values may change in the future. + - Two new command line arguments "-a FACTOR" and "-b BYTES" + for xmlwf to further tighten billion laughs protection + parameters when desired. + If you ever need to increase the defaults for non-attack XML + payload, please file a bug report with libexpat. + + Bug fixes: + #332 #470 For (non-default) compilation with -DEXPAT_MIN_SIZE=ON (CMake) + or CPPFLAGS=-DXML_MIN_SIZE (GNU Autotools): Fix segfault + for UTF-16 payloads containing CDATA sections. + #485 #486 Autotools: Fix generated CMake files for non-64bit and + non-Linux platforms (e.g. macOS and MinGW in particular) + that were introduced with release 2.3.0 + + Other changes: + #468 #469 xmlwf: Improve help output and the xmlwf man page + #463 xmlwf: Improve maintainability through some refactoring + #477 xmlwf: Fix man page DocBook validity + #458 #459 CMake: Support absolute paths for both CMAKE_INSTALL_LIBDIR + and CMAKE_INSTALL_INCLUDEDIR + #471 #481 CMake: Add support for standard variable BUILD_SHARED_LIBS + #457 Unexpose symbol _INTERNAL_trim_to_complete_utf8_characters + #467 Resolve macro HAVE_EXPAT_CONFIG_H + #472 Delete unused legacy helper file "conftools/PrintPath" + #473 #483 Improve attribution + #464 #465 #477 doc/reference.html: Fix XHTML validity + #475 #478 doc/reference.html: Replace the 90s look by OK.css + #479 Version info bumped from 8:0:7 to 9:0:8 + due to addition of new symbols and error codes; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #456 CI: Enable periodic runs + #457 CI: Start covering the list of exported symbols + #474 CI: Isolate coverage task + #476 #482 CI: Adapt to breaking changes in image "ubuntu-18.04" + #477 CI: Cover well-formedness and DocBook/XHTML validity + of doc/reference.html and doc/xmlwf.xml + + Special thanks to: + Dimitry Andric + Eero Helenius + Nick Wellnhofer + Rhodri James + Tomas Korbar + Yury Gribov + and + Clang LeakSan + JetBrains + OSS-Fuzz + +Release 2.3.0 Thu March 25 2021 + Bug fixes: + #438 When calling XML_ParseBuffer without a prior successful call to + XML_GetBuffer as a user, no longer trigger undefined behavior + (by adding an integer to a NULL pointer) but rather return + XML_STATUS_ERROR and set the error code to (new) code + XML_ERROR_NO_BUFFER. Found by UBSan (UndefinedBehaviorSanitizer) + of Clang 11 (but not Clang 9). + #444 xmlwf: Exit status 2 was used for both: + - malformed input files (documented) and + - invalid command-line arguments (undocumented). + The case of invalid command-line arguments now + has its own exit status 4, resolving the ambiguity. + + Other changes: + #439 xmlwf: Add argument -k to allow continuing after + non-fatal errors + #439 xmlwf: Add section about exit status to the -h help output + #422 #426 #447 Windows: Drop support for Visual Studio <=14.0/2015 + #434 Windows: CMake: Detect unsupported Visual Studio at + configure time (rather than at compile time) + #382 #428 testrunner: Make verbose mode (argument "-v") report + about passed tests, and make default mode report about + failures, as well. + #442 CMake: Call "enable_language(CXX)" prior to tinkering + with CMAKE_CXX_* variables + #448 Document use of libexpat from a CMake-based project + #451 Autotools: Install CMake files as generated by CMake 3.19.6 + so that users with "find_package(expat [..] CONFIG [..])" + are served on distributions that are *not* using the CMake + build system inside for libexpat packaging + #436 #437 Autotools: Drop obsolescent macro AC_HEADER_STDC + #450 #452 Autotools: Resolve use of obsolete macro AC_CONFIG_HEADER + #441 Address compiler warnings + #443 Version info bumped from 7:12:6 to 8:0:7 + due to addition of error code XML_ERROR_NO_BUFFER + (see https://verbump.de/ for what these numbers do) + + Infrastructure: + #435 #446 Replace Travis CI by GitHub Actions + + Special thanks to: + Alexander Richardson + Oleksandr Popovych + Thomas Beutlich + Tim Bray + and + Clang LeakSan, Clang 11 UBSan and the Clang team + +Release 2.2.10 Sat October 3 2020 + Bug fixes: + #390 #395 #398 Fix undefined behavior during parsing caused by + pointer arithmetic with NULL pointers + #404 #405 Fix reading uninitialized variable during parsing + #406 xmlwf: Add missing check for malloc NULL return + + Other changes: + #396 Windows: Drop support for Visual Studio <=8.0/2005 + #409 Windows: Add missing file "Changes" to the installer + to fix compilation with CMake from installed sources + #403 xmlwf: Document exit codes in xmlwf manpage and + exit with code 3 (rather than code 1) for output errors + when used with "-d DIRECTORY" + #356 #359 MinGW: Provide declaration of rand_s for mingwrt <5.3.0 + #383 #392 Autotools: Use -Werror while configure tests the compiler + for supported compile flags to avoid false positives + #383 #393 #394 Autotools: Improve handling of user (C|CPP|CXX|LD)FLAGS, + e.g. ensure that they have the last word over flags added + while running ./configure + #360 CMake: Create libexpatw.{dll,so} and expatw.pc (with emphasis + on suffix "w") with -DEXPAT_CHAR_TYPE=(ushort|wchar_t) + #360 CMake: Detect and deny unsupported build combinations + involving -DEXPAT_CHAR_TYPE=(ushort|wchar_t) + #360 CMake: Install pre-compiled shipped xmlwf.1 manpage in case + of -DEXPAT_BUILD_DOCS=OFF + #375 #380 #419 CMake: Fix use of Expat by means of add_subdirectory + #407 #408 CMake: Keep expat target name constant at "expat" + (i.e. refrain from using the target name to control + build artifact filenames) + #385 CMake: Fix compilation with -DEXPAT_SHARED_LIBS=OFF for + Windows + CMake: Expose man page compilation as target "xmlwf-manpage" + #413 #414 CMake: Introduce option EXPAT_BUILD_PKGCONFIG + to control generation of pkg-config file "expat.pc" + #424 CMake: Add minimalistic support for building binary packages + with CMake target "package"; based on CPack + #366 CMake: Add option -DEXPAT_OSSFUZZ_BUILD=(ON|OFF) with + default OFF to build fuzzer code against OSS-Fuzz and + related environment variable LIB_FUZZING_ENGINE + #354 Fix testsuite for -DEXPAT_DTD=OFF and -DEXPAT_NS=OFF, each + #354 #355 .. + #356 #412 Address compiler warnings + #368 #369 Address pngcheck warnings with doc/*.png images + #425 Version info bumped from 7:11:6 to 7:12:6 + + Special thanks to: + asavah + Ben Wagner + Bhargava Shastry + Frank Landgraf + Jeffrey Walton + Joe Orton + Kleber Tarcísio + Ma Lin + Maciej Sroczyński + Mohammed Khajapasha + Vadim Zeitlin + and + Cppcheck 2.0 and the Cppcheck team + +Release 2.2.9 Wed September 25 2019 Other changes: examples: Drop executable bits from elements.c #349 Windows: Change the name of the Windows DLLs from expat*.dll @@ -17,7 +293,7 @@ Release 2.2.9 Wed Septemper 25 2019 Special thanks to: Ben Wagner -Release 2.2.8 Fri Septemper 13 2019 +Release 2.2.8 Fri September 13 2019 Security fixes: #317 #318 CVE-2019-15903 -- Fix heap overflow triggered by XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber), @@ -115,10 +391,10 @@ Release 2.2.8 Fri Septemper 13 2019 Special thanks to: David Loffredo Joonun Jang - Khajapasha Mohammed Kishore Kunche Marco Maggi Mitch Phillips + Mohammed Khajapasha Rolf Ade xantares Zhongyuan Zhou diff --git a/contrib/expat/Makefile.am b/contrib/expat/Makefile.am index 5e1d37dd1a83..e6e7971ec8b5 100644 --- a/contrib/expat/Makefile.am +++ b/contrib/expat/Makefile.am @@ -6,7 +6,8 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2018 KangLin # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -53,13 +54,28 @@ pkgconfig_DATA = expat.pc pkgconfigdir = $(libdir)/pkgconfig +dist_cmake_DATA = \ + cmake/autotools/expat.cmake + +nodist_cmake_DATA = \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake \ + cmake/expat-config.cmake + +cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@ + + _EXTRA_DIST_CMAKE = \ - cmake/expat-config.cmake.in \ + cmake/autotools/expat-noconfig__linux.cmake.in \ + cmake/autotools/expat-noconfig__macos.cmake.in \ + cmake/autotools/expat-noconfig__windows.cmake.in \ + cmake/autotools/expat-package-init.cmake \ cmake/mingw-toolchain.cmake \ \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ + expat.pc.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ @@ -74,11 +90,14 @@ EXTRA_DIST = \ \ conftools/expat.m4 \ conftools/get-version.sh \ - conftools/PrintPath \ + \ + fuzz/xml_parsebuffer_fuzzer.c \ + fuzz/xml_parse_fuzzer.c \ \ xmlwf/xmlwf_helpgen.py \ xmlwf/xmlwf_helpgen.sh \ \ + buildconf.sh \ Changes \ README.md \ \ diff --git a/contrib/expat/Makefile.in b/contrib/expat/Makefile.in index 89bf68febc48..34f900a61630 100644 --- a/contrib/expat/Makefile.in +++ b/contrib/expat/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -22,7 +22,8 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2018 KangLin # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -138,12 +139,14 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) + $(am__configure_deps) $(dist_cmake_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = expat_config.h -CONFIG_CLEAN_FILES = expat.pc run.sh +CONFIG_CLEAN_FILES = expat.pc cmake/expat-config.cmake \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake run.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -199,8 +202,9 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(pkgconfigdir)" -DATA = $(pkgconfig_DATA) +am__installdirs = "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" \ + "$(DESTDIR)$(pkgconfigdir)" +DATA = $(dist_cmake_DATA) $(nodist_cmake_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -209,8 +213,8 @@ am__recursive_targets = \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)expat_config.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + expat_config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -227,18 +231,17 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope DIST_SUBDIRS = lib examples tests xmlwf doc am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \ $(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \ + $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in \ + $(top_srcdir)/cmake/expat-config.cmake.in \ $(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \ $(top_srcdir)/conftools/config.guess \ $(top_srcdir)/conftools/config.sub \ $(top_srcdir)/conftools/install-sh \ $(top_srcdir)/conftools/ltmain.sh \ - $(top_srcdir)/conftools/missing AUTHORS COPYING \ + $(top_srcdir)/conftools/missing AUTHORS COPYING README.md \ conftools/ar-lib conftools/compile conftools/config.guess \ conftools/config.sub conftools/depcomp conftools/install-sh \ conftools/ltmain.sh conftools/missing @@ -281,13 +284,19 @@ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.lz \ $(distdir).tar.xz GZIP_ENV = --best DIST_TARGETS = dist-lzip dist-xz dist-bzip2 dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -297,8 +306,9 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -314,7 +324,15 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ 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@ FILEMAP = @FILEMAP@ GREP = @GREP@ @@ -327,6 +345,8 @@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAGE = @LIBAGE@ LIBCURRENT = @LIBCURRENT@ +LIBDIR_BASENAME = @LIBDIR_BASENAME@ +LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBREVISION = @LIBREVISION@ LIBS = @LIBS@ @@ -356,6 +376,9 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SO_MAJOR = @SO_MAJOR@ +SO_MINOR = @SO_MINOR@ +SO_PATCH = @SO_PATCH@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ @@ -366,6 +389,7 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -403,6 +427,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -423,13 +448,26 @@ LIBTOOLFLAGS = --verbose SUBDIRS = lib $(am__append_1) $(am__append_2) $(am__append_3) pkgconfig_DATA = expat.pc pkgconfigdir = $(libdir)/pkgconfig +dist_cmake_DATA = \ + cmake/autotools/expat.cmake + +nodist_cmake_DATA = \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake \ + cmake/expat-config.cmake + +cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@ _EXTRA_DIST_CMAKE = \ - cmake/expat-config.cmake.in \ + cmake/autotools/expat-noconfig__linux.cmake.in \ + cmake/autotools/expat-noconfig__macos.cmake.in \ + cmake/autotools/expat-noconfig__windows.cmake.in \ + cmake/autotools/expat-package-init.cmake \ cmake/mingw-toolchain.cmake \ \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ + expat.pc.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ @@ -444,11 +482,14 @@ EXTRA_DIST = \ \ conftools/expat.m4 \ conftools/get-version.sh \ - conftools/PrintPath \ + \ + fuzz/xml_parsebuffer_fuzzer.c \ + fuzz/xml_parse_fuzzer.c \ \ xmlwf/xmlwf_helpgen.py \ xmlwf/xmlwf_helpgen.sh \ \ + buildconf.sh \ Changes \ README.md \ \ @@ -509,6 +550,12 @@ distclean-hdr: -rm -f expat_config.h stamp-h1 expat.pc: $(top_builddir)/config.status $(srcdir)/expat.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/expat-config.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/expat-config.cmake.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/autotools/expat-config-version.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/autotools/expat-noconfig.cmake: $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ run.sh: $(top_builddir)/config.status $(srcdir)/run.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -520,6 +567,48 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt +install-dist_cmakeDATA: $(dist_cmake_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \ + done + +uninstall-dist_cmakeDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir) +install-nodist_cmakeDATA: $(nodist_cmake_DATA) + @$(NORMAL_INSTALL) + @list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \ + done + +uninstall-nodist_cmakeDATA: + @$(NORMAL_UNINSTALL) + @list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ @@ -647,7 +736,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -728,6 +816,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -770,6 +862,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -785,7 +879,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -841,7 +935,7 @@ check: check-recursive all-am: Makefile $(DATA) expat_config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + for dir in "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -896,7 +990,8 @@ info: info-recursive info-am: -install-data-am: install-pkgconfigDATA +install-data-am: install-dist_cmakeDATA install-nodist_cmakeDATA \ + install-pkgconfigDATA install-dvi: install-dvi-recursive @@ -942,7 +1037,8 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-pkgconfigDATA +uninstall-am: uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \ + uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip @@ -950,18 +1046,21 @@ uninstall-am: uninstall-pkgconfigDATA am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dist_cmakeDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-pkgconfigDATA \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-pkgconfigDATA + install-man install-nodist_cmakeDATA install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \ + uninstall-pkgconfigDATA .PRECIOUS: Makefile diff --git a/contrib/expat/README.md b/contrib/expat/README.md index 1cc52b014489..6fdd6148714b 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -1,12 +1,14 @@ -[![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat) +[![Run Linux Travis CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) +[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) +[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) -# Expat, Release 2.2.9 +# Expat, Release 2.4.3 This is Expat, a C library for parsing XML, started by -[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997. +[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997. Expat is a stream-oriented XML parser. This means that you register handlers with the parser before starting the parse. These handlers are called when the parser discovers the associated structures in the @@ -14,13 +16,14 @@ document being parsed. A start tag is an example of the kind of structures for which you may register handlers. Expat supports the following compilers: + - GNU GCC >=4.5 - LLVM Clang >=3.5 -- Microsoft Visual Studio >=8.0/2005 +- Microsoft Visual Studio >=15.0/2017 (rolling `${today} minus 5 years`) -Windows users should use the -[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/), -which includes both precompiled libraries and executables, and source code for +Windows users can use the +[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases), +which includes both pre-compiled libraries and executables, and source code for developers. Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html). @@ -30,6 +33,67 @@ contained in the file distributed with this package. This license is the same as the MIT/X Consortium license. + +## Using libexpat in your CMake-Based Project + +There are two ways of using libexpat with CMake: + +### a) Module Mode + +This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html). + +Notice the *uppercase* `EXPAT` in the following example: + +```cmake +cmake_minimum_required(VERSION 3.0) # or 3.10, see below + +project(hello VERSION 1.0.0) + +find_package(EXPAT 2.2.8 MODULE REQUIRED) + +add_executable(hello + hello.c +) + +# a) for CMake >=3.10 (see CMake's FindEXPAT docs) +target_link_libraries(hello PUBLIC EXPAT::EXPAT) + +# b) for CMake >=3.0 +target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS}) +target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES}) +``` + +### b) Config Mode + +This approach requires files from… + +- libexpat >=2.2.8 where packaging uses the CMake build system +or +- libexpat >=2.3.0 where packaging uses the GNU Autotools build system + on Linux +or +- libexpat >=2.4.0 where packaging uses the GNU Autotools build system + on macOS or MinGW. + +Notice the *lowercase* `expat` in the following example: + +```cmake +cmake_minimum_required(VERSION 3.0) + +project(hello VERSION 1.0.0) + +find_package(expat 2.2.8 CONFIG REQUIRED char dtd ns) + +add_executable(hello + hello.c +) + +target_link_libraries(hello PUBLIC expat::expat) +``` + + +## Building from a Git Clone + If you are building Expat from a check-out from the [Git repository](https://github.com/libexpat/libexpat/), you need to run a script that generates the configure script using the @@ -43,6 +107,11 @@ autoconf 2.58 or newer. Run the script like this: Once this has been done, follow the same instructions as for building from a source distribution. + +## Building from a Source Distribution + +### a) Building with the configure script (i.e. GNU Autotools) + To build Expat from a source distribution, you first run the configuration shell script in the top level distribution directory: @@ -132,8 +201,14 @@ A reference manual is available in the file `doc/reference.html` in this distribution. -The CMake build system is still *experimental* and will replace the primary +### b) Building with CMake + +The CMake build system is still *experimental* and may replace the primary build system based on GNU Autotools at some point when it is ready. + + +#### Available Options + For an idea of the available (non-advanced) options for building with CMake: ```console @@ -156,6 +231,9 @@ EXPAT_BUILD_EXAMPLES:BOOL=ON // build fuzzers for the expat library EXPAT_BUILD_FUZZERS:BOOL=OFF +// build pkg-config file +EXPAT_BUILD_PKGCONFIG:BOOL=ON + // build the tests for expat library EXPAT_BUILD_TESTS:BOOL=ON @@ -171,6 +249,9 @@ EXPAT_ENABLE_INSTALL:BOOL=ON // Use /MT flag (static CRT) when compiling in MSVC EXPAT_MSVC_STATIC_CRT:BOOL=OFF +// build fuzzers via ossfuzz for the expat library +EXPAT_OSSFUZZ_BUILD:BOOL=OFF + // build a shared expat library EXPAT_SHARED_LIBS:BOOL=ON diff --git a/contrib/expat/buildconf.sh b/contrib/expat/buildconf.sh new file mode 100755 index 000000000000..5edbc565bc27 --- /dev/null +++ b/contrib/expat/buildconf.sh @@ -0,0 +1,55 @@ +#! /usr/bin/env bash +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2018 Marco Maggi +# Licensed under the MIT license: +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. + +set -e + +# File expat_config.h.in (as generated by autoheader by autoreconf) contains +# macro SIZEOF_VOID_P which is (1) not really needed by Expat as of today and +# (2) a problem to "multilib" systems with one shared installed +# /usr/include/expat_config.h for two Expats with different "void *" sizes +# installed in e.g. /usr/lib32 and /usr/lib64. Hence we patch macro +# SIZEOF_VOID_P out of template expat_config.h.in so that configure will +# not put SIZEOF_VOID_P in the eventual expat_config.h. +patch_expat_config_h_in() { + local filename="$1" + local sizeof_void_p_line_number="$(fgrep -n SIZEOF_VOID_P "${filename}" | awk -F: '{print $1}')" + [[ ${sizeof_void_p_line_number} =~ ^[0-9]+$ ]] # cheap assert + local first_line_to_delete=$(( sizeof_void_p_line_number - 1 )) + local last_line_to_delete=$(( sizeof_void_p_line_number + 1 )) + # Note: Avoiding "sed -i" only for macOS portability. + local tempfile="$(mktemp)" + sed "${first_line_to_delete},${last_line_to_delete}d" "${filename}" > "${tempfile}" + mv "${tempfile}" "${filename}" +} + +autoreconf --warnings=all --install --verbose "$@" + +patch_expat_config_h_in expat_config.h.in diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index e2b9a1146286..c285a2b60ed7 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -1,21 +1,54 @@ dnl configuration script for expat dnl Process this file with autoconf to produce a configure script. +dnl __ __ _ +dnl ___\ \/ /_ __ __ _| |_ +dnl / _ \\ /| '_ \ / _` | __| +dnl | __// \| |_) | (_| | |_ +dnl \___/_/\_\ .__/ \__,_|\__| +dnl |_| XML parser dnl -dnl Copyright 2000 Clark Cooper +dnl Copyright (c) 2000 Clark Cooper +dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. +dnl Copyright (c) 2001-2003 Greg Stein +dnl Copyright (c) 2006-2012 Karl Waclawek +dnl Copyright (c) 2016-2022 Sebastian Pipping +dnl Copyright (c) 2017 S. P. Zeidler +dnl Copyright (c) 2017 Stephen Groat +dnl Copyright (c) 2017-2020 Joe Orton +dnl Copyright (c) 2018 Yury Gribov +dnl Copyright (c) 2018 Benjamin Peterson +dnl Copyright (c) 2018 Marco Maggi +dnl Copyright (c) 2018 KangLin +dnl Copyright (c) 2019 Mohammed Khajapasha +dnl Copyright (c) 2019 Kishore Kunche +dnl Copyright (c) 2020 Jeffrey Walton +dnl Licensed under the MIT license: dnl -dnl This file is part of EXPAT. +dnl Permission is hereby granted, free of charge, to any person obtaining +dnl a copy of this software and associated documentation files (the +dnl "Software"), to deal in the Software without restriction, including +dnl without limitation the rights to use, copy, modify, merge, publish, +dnl distribute, sublicense, and/or sell copies of the Software, and to permit +dnl persons to whom the Software is furnished to do so, subject to the +dnl following conditions: dnl -dnl EXPAT is free software; you can redistribute it and/or modify it -dnl under the terms of the License (based on the MIT/X license) contained -dnl in the file COPYING that comes with this distribution. +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +dnl NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +dnl USE OR OTHER DEALINGS IN THE SOFTWARE. dnl Ensure that Expat is configured with autoconf 2.69 or newer. -AC_PREREQ(2.69) +AC_PREREQ([2.69]) dnl Get the version number of Expat, using m4's esyscmd() command to run dnl the command at m4-generation time. This allows us to create an m4 -dnl symbol holding the correct version number. AC_INIT() requires the +dnl symbol holding the correct version number. AC_INIT requires the dnl version number at m4-time, rather than when ./configure is run, so dnl all this must happen as part of m4, not as part of the shell code dnl contained in ./configure. @@ -27,7 +60,7 @@ m4_define([expat_version], m4_ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], [2.2.x])) -AC_INIT(expat, expat_version, expat-bugs@libexpat.org) +AC_INIT([expat], expat_version, [expat-bugs@libexpat.org]) m4_undefine([expat_version]) AC_CONFIG_SRCDIR([Makefile.in]) @@ -48,12 +81,11 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=7 # sync -LIBREVISION=11 # with -LIBAGE=6 # CMakeLists.txt! +LIBCURRENT=9 # sync +LIBREVISION=3 # with +LIBAGE=8 # CMakeLists.txt! -AX_APPEND_FLAG([-DHAVE_EXPAT_CONFIG_H], [CPPFLAGS]) -AC_CONFIG_HEADER([expat_config.h]) +AC_CONFIG_HEADERS([expat_config.h]) AM_PROG_AR AC_PROG_INSTALL @@ -69,30 +101,32 @@ AC_SUBST(LIBAGE) AC_LANG([C]) AC_PROG_CC_C99 + AS_IF([test "$GCC" = yes], - [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [CFLAGS]) + [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS]) dnl Be careful about adding the -fexceptions option; some versions of dnl GCC don't support it and it causes extra warnings that are only dnl distracting; avoid. - AX_APPEND_COMPILE_FLAGS([-fexceptions], [CFLAGS]) - AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [CFLAGS]) - AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [CFLAGS]) - AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [CFLAGS]) - AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wmisleading-indentation], [CFLAGS])]) + AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [AM_CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [AM_CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [AM_CFLAGS]) + AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation], [AM_CFLAGS])]) AC_LANG_PUSH([C++]) AC_PROG_CXX + AS_IF([test "$GCC" = yes], - [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [CXXFLAGS]) + [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CXXFLAGS]) dnl Be careful about adding the -fexceptions option; some versions of dnl GCC don't support it and it causes extra warnings that are only dnl distracting; avoid. - AX_APPEND_COMPILE_FLAGS([-fexceptions], [CXXFLAGS]) - AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [CXXFLAGS])]) + AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CXXFLAGS]) + AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [AM_CXXFLAGS])]) AC_LANG_POP([C++]) AS_IF([test "$GCC" = yes], - [AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[LDFLAGS])]) + [AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[AM_LDFLAGS])]) dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312) AS_CASE(["$LD"],[*clang*], @@ -100,11 +134,8 @@ AS_CASE(["$LD"],[*clang*], [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])]) EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([ - AX_APPEND_FLAG([-fvisibility=hidden], [CFLAGS]) - AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [CFLAGS])]) - -dnl Checks for header files. -AC_HEADER_STDC + AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS]) + AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])]) dnl Checks for typedefs, structures, and compiler characteristics. @@ -149,8 +180,13 @@ AS_CASE("${host_os}", AC_MSG_NOTICE([detected OS: MinGW])]) 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]) +LT_LIB_M AC_ARG_WITH([libbsd], [AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])], @@ -307,8 +343,67 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x]) + +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_ATTR_INFO=OFF]) +EXPAT_DTD=ON +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}], + [EXPAT_CONTEXT_BYTES=OFF]) +AS_IF([test "x${UNICODE_TRUE}" = x], + [AS_IF( + [test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x], + [EXPAT_CHAR_TYPE=wchar_t], + [EXPAT_CHAR_TYPE=ushort])], + [EXPAT_CHAR_TYPE=char]) +PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake +LIBDIR_BASENAME="$(basename "${libdir}")" +SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")" +SO_MINOR="${LIBAGE}" +SO_PATCH="${LIBREVISION}" +AC_CHECK_SIZEOF([void *]) # sets ac_cv_sizeof_void_p +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]) +AC_SUBST_FILE([PACKAGE_INIT]) +AC_SUBST([LIBDIR_BASENAME]) +AC_SUBST([SO_MAJOR]) +AC_SUBST([SO_MINOR]) +AC_SUBST([SO_PATCH]) +AC_SUBST([ac_cv_sizeof_void_p]) + + +dnl write the Automake flags we set +AC_SUBST([AM_CPPFLAGS]) +AC_SUBST([AM_CFLAGS]) +AC_SUBST([AM_CXXFLAGS]) +AC_SUBST([AM_LDFLAGS]) + +AS_CASE("${host_os}", + [darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in], + [mingw*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in], + [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in]) AC_CONFIG_FILES([Makefile] [expat.pc] + [cmake/expat-config.cmake] + [cmake/autotools/expat-config-version.cmake] + [cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}] [doc/Makefile] [examples/Makefile] [lib/Makefile] @@ -317,3 +412,18 @@ AC_CONFIG_FILES([Makefile] [xmlwf/Makefile]) AC_CONFIG_FILES([run.sh], [chmod +x run.sh]) AC_OUTPUT + + +AC_MSG_NOTICE([ + +Automake flags (can be overridden by user flags): + [AM_CPPFLAGS]: ${AM_CPPFLAGS} + [AM_CFLAGS]: ${AM_CFLAGS} + [AM_CXXFLAGS]: ${AM_CXXFLAGS} + [AM_LDFLAGS]: ${AM_LDFLAGS} + +User flags (override Automake flags on conflict): + CPPFLAGS: ${CPPFLAGS} + CFLAGS: ${CFLAGS} + CXXFLAGS: ${CXXFLAGS} + LDFLAGS: ${LDFLAGS}]) diff --git a/contrib/expat/doc/Makefile.am b/contrib/expat/doc/Makefile.am index e2f029837a41..16987e8dec40 100644 --- a/contrib/expat/doc/Makefile.am +++ b/contrib/expat/doc/Makefile.am @@ -6,7 +6,9 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2017 Stephen Groat +# Copyright (c) 2017 Joe Orton # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -52,7 +54,7 @@ clean-local-check: $(RM) xmlwf.1 EXTRA_DIST = \ - expat.png \ + ok.min.css \ reference.html \ style.css \ valid-xhtml10.png \ diff --git a/contrib/expat/doc/Makefile.in b/contrib/expat/doc/Makefile.in index e021e8c675fe..c48834052935 100644 --- a/contrib/expat/doc/Makefile.in +++ b/contrib/expat/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -22,7 +22,9 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2017 Stephen Groat +# Copyright (c) 2017 Joe Orton # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -193,7 +195,11 @@ am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -203,8 +209,9 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -220,7 +227,15 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ 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@ FILEMAP = @FILEMAP@ GREP = @GREP@ @@ -233,6 +248,8 @@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAGE = @LIBAGE@ LIBCURRENT = @LIBCURRENT@ +LIBDIR_BASENAME = @LIBDIR_BASENAME@ +LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBREVISION = @LIBREVISION@ LIBS = @LIBS@ @@ -262,6 +279,9 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SO_MAJOR = @SO_MAJOR@ +SO_MINOR = @SO_MINOR@ +SO_PATCH = @SO_PATCH@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ @@ -272,6 +292,7 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -309,6 +330,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -319,7 +341,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1 EXTRA_DIST = \ - expat.png \ + ok.min.css \ reference.html \ style.css \ valid-xhtml10.png \ @@ -413,7 +435,6 @@ ctags CTAGS: cscope cscopelist: @WITH_DOCBOOK_TRUE@dist-hook: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/contrib/expat/doc/expat.png b/contrib/expat/doc/expat.png deleted file mode 100644 index 3d88eac4a133..000000000000 Binary files a/contrib/expat/doc/expat.png and /dev/null differ diff --git a/contrib/expat/doc/ok.min.css b/contrib/expat/doc/ok.min.css new file mode 100644 index 000000000000..8b5f86e7042c --- /dev/null +++ b/contrib/expat/doc/ok.min.css @@ -0,0 +1,2 @@ +/*! OK.css v1.0.3 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--ok-mono:SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);background-color:var(--ok-bg-0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3)}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,audio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var(--ok-s-3);border:var(--ok-b-0);border-radius:var(--ok-br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}input,select{padding:var(--ok-s-2);background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type=radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{position:absolute;top:0;right:0;background-color:transparent;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}input[type=range]{overflow:visible;line-height:inherit;font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-ms-thumb{background-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]:disabled::-webkit-slider-runnable-track{cursor:default}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok-down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color:var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-button{cursor:default;opacity:.5}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-file-upload-button{cursor:pointer}button:disabled,input[type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;border-radius:var(--ok-br);display:block;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;margin-left:auto;margin-right:auto;overflow-x:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{font-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp{padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}audio,img,video{margin-left:auto;margin-right:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 23e9a979707b..1629413e541e 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -3,26 +3,55 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Expat XML Parser + - - - - - - - - - -
(Expat logo)
Release 2.0.1
+
+

+ The Expat XML Parser + Release 2.4.3 +

+

Expat is a library, written in C, for parsing XML documents. It's @@ -120,6 +149,13 @@ interface.

  • XML_GetInputContext
  • +
  • + Billion Laughs Attack Protection + +
  • Miscellaneous Functions
    • XML_SetUserData
    • @@ -900,7 +936,8 @@ whether the parse can be resumed in the future.

      Parser Creation

      -
      +

      XML_ParserCreate

      +
       XML_Parser XMLCALL
       XML_ParserCreate(const XML_Char *encoding);
       
      @@ -917,7 +954,8 @@ encoding declaration. There are four built-in encodings: Any other value will invoke a call to the UnknownEncodingHandler.
  • -
    +

    XML_ParserCreateNS

    +
     XML_Parser XMLCALL
     XML_ParserCreateNS(const XML_Char *encoding,
                        XML_Char sep);
    @@ -936,7 +974,8 @@ the local part will be concatenated without any separator - this is intended
     to support RDF processors. It is a programming error to use the null separator
     with namespace triplets.
     
    -
    +

    XML_ParserCreate_MM

    +
     XML_Parser XMLCALL
     XML_ParserCreate_MM(const XML_Char *encoding,
                         const XML_Memory_Handling_Suite *ms,
    @@ -958,7 +997,8 @@ and the character pointed at by sep is used as the separator between
     the namespace URI and the local part of the name.

    -
    +

    XML_ExternalEntityParserCreate

    +
     XML_Parser XMLCALL
     XML_ExternalEntityParserCreate(XML_Parser p,
                                    const XML_Char *context,
    @@ -974,7 +1014,8 @@ changing functions on this parser (unless you want it to act
     differently than the parent parser).
     
     
    -
    +

    XML_ParserFree

    +
     void XMLCALL
     XML_ParserFree(XML_Parser p);
     
    @@ -983,7 +1024,8 @@ Free memory used by the parser. Your application is responsible for freeing any memory associated with user data. -
    +

    XML_ParserReset

    +
     XML_Bool XMLCALL
     XML_ParserReset(XML_Parser p,
                     const XML_Char *encoding);
    @@ -1014,7 +1056,7 @@ if they apply to the parser created by
     XML_ExternalEntityParserCreate.

    -

    Note: the len argument passed to these functions +

    Note: The len argument passed to these functions should be considerably less than the maximum value for an integer, as it could create an integer overflow situation if the added lengths of a buffer and the unprocessed portion of the previous buffer @@ -1022,7 +1064,8 @@ exceed the maximum integer value. Input data at the end of a buffer will remain unprocessed if it is part of an XML token for which the end is not part of that buffer.

    -
    +

    XML_Parse

    +
     enum XML_Status XMLCALL
     XML_Parse(XML_Parser p,
               const char *s,
    @@ -1049,7 +1092,8 @@ If a parse error occurred, it returns XML_STATUS_ERROR.
     Otherwise it returns XML_STATUS_OK value.
     
     
    -
    +

    XML_ParseBuffer

    +
     enum XML_Status XMLCALL
     XML_ParseBuffer(XML_Parser p,
                     int len,
    @@ -1063,7 +1107,8 @@ buffer from Expat with the 
     
    -
    +

    XML_GetBuffer

    +
     void * XMLCALL
     XML_GetBuffer(XML_Parser p,
                   int len);
    @@ -1071,7 +1116,8 @@ XML_GetBuffer(XML_Parser p,
     
    -
    +

    XML_StopParser

    +
     enum XML_Status XMLCALL
     XML_StopParser(XML_Parser p,
                    XML_Bool resumable);
    @@ -1111,7 +1158,7 @@ XML_StopParser(XML_Parser p,
     call-back handler, except when aborting (when resumable
     is XML_FALSE) an already suspended parser.  Some
     call-backs may still follow because they would otherwise get
    -lost, including
    +lost, including

    • the end element handler for empty elements when stopped in the start element handler,
    • @@ -1120,7 +1167,7 @@ lost, including
    • the character data handler when stopped in the character data handler while making multiple call-backs on a contiguous chunk of characters,
    -and possibly others.

    +

    and possibly others.

    This can be called from most handlers, including DTD related call-backs, except when parsing an external parameter entity and @@ -1166,7 +1213,8 @@ implementation of that handler to call New in Expat 1.95.8.

    -
    +

    XML_ResumeParser

    +
     enum XML_Status XMLCALL
     XML_ResumeParser(XML_Parser p);
     
    @@ -1191,7 +1239,8 @@ appropriate moment.

    New in Expat 1.95.8.

    -
    +

    XML_GetParsingStatus

    +
     void XMLCALL
     XML_GetParsingStatus(XML_Parser p,
                          XML_ParsingStatus *status);
    @@ -1240,7 +1289,8 @@ Note that you'll receive them in this form independent of the original
     encoding of the document.

    -
    +

    XML_SetStartElementHandler

    +
     void XMLCALL
     XML_SetStartElementHandler(XML_Parser p,
                                XML_StartElementHandler start);
    @@ -1261,7 +1311,8 @@ by a null pointer.

    -
    +

    XML_SetEndElementHandler

    +
     void XMLCALL
     XML_SetEndElementHandler(XML_Parser p,
                              XML_EndElementHandler);
    @@ -1276,7 +1327,8 @@ generates a call to both start and end handlers.

    -
    +

    XML_SetElementHandler

    +
     void XMLCALL
     XML_SetElementHandler(XML_Parser p,
                           XML_StartElementHandler start,
    @@ -1286,7 +1338,8 @@ XML_SetElementHandler(XML_Parser p,
     
    -
    +

    XML_SetCharacterDataHandler

    +
     void XMLCALL
     XML_SetCharacterDataHandler(XML_Parser p,
                                 XML_CharacterDataHandler charhndl)
    @@ -1298,7 +1351,7 @@ typedef void
                                         int len);
     

    Set a text handler. The string your handler receives -is NOT nul-terminated. You have to use the length argument +is NOT null-terminated. You have to use the length argument to deal with the end of the string. A single block of contiguous text free of markup may still result in a sequence of calls to this handler. In other words, if you're searching for a pattern in the text, it may @@ -1309,7 +1362,8 @@ will continue calling back until the end of the block is reached.

    -
    +

    XML_SetProcessingInstructionHandler

    +
     void XMLCALL
     XML_SetProcessingInstructionHandler(XML_Parser p,
                                         XML_ProcessingInstructionHandler proc)
    @@ -1327,7 +1381,8 @@ it after skipping all whitespace after the initial word.

    -
    +

    XML_SetCommentHandler

    +
     void XMLCALL
     XML_SetCommentHandler(XML_Parser p,
                           XML_CommentHandler cmnt)
    @@ -1342,7 +1397,8 @@ delimiters.

    -
    +

    XML_SetStartCdataSectionHandler

    +
     void XMLCALL
     XML_SetStartCdataSectionHandler(XML_Parser p,
                                     XML_StartCdataSectionHandler start);
    @@ -1355,7 +1411,8 @@ typedef void
     
    -
    +

    XML_SetEndCdataSectionHandler

    +
     void XMLCALL
     XML_SetEndCdataSectionHandler(XML_Parser p,
                                   XML_EndCdataSectionHandler end);
    @@ -1368,7 +1425,8 @@ typedef void
     
    -
    +

    XML_SetCdataSectionHandler

    +
     void XMLCALL
     XML_SetCdataSectionHandler(XML_Parser p,
                                XML_StartCdataSectionHandler start,
    @@ -1378,7 +1436,8 @@ XML_SetCdataSectionHandler(XML_Parser p,
     
    -
    +

    XML_SetDefaultHandlerExpand

    +
     void XMLCALL
     XML_SetDefaultHandlerExpand(XML_Parser p,
                                 XML_DefaultHandler hndl)
    @@ -1429,7 +1489,8 @@ href="#XML_DefaultCurrent">XML_DefaultCurrent.

    -
    +

    XML_SetExternalEntityRefHandler

    +
     void XMLCALL
     XML_SetExternalEntityRefHandler(XML_Parser p,
                                     XML_ExternalEntityRefHandler hndl)
    @@ -1482,7 +1543,8 @@ parser, the body of the external entity can be recursively parsed.

    information into global or static variables.

    -
    +

    XML_SetExternalEntityRefHandlerArg

    +
     void XMLCALL
     XML_SetExternalEntityRefHandlerArg(XML_Parser p,
                                        void *arg)
    @@ -1508,7 +1570,8 @@ properly.

    -
    +

    XML_SetSkippedEntityHandler

    +
     void XMLCALL
     XML_SetSkippedEntityHandler(XML_Parser p,
                                 XML_SkippedEntityHandler handler)
    @@ -1528,14 +1591,15 @@ typedef void
     	   has been called.
     
     

    The is_parameter_entity argument will be non-zero for -a parameter entity and zero for a general entity.

    Note: skipped +a parameter entity and zero for a general entity.

    Note: Skipped parameter entities in declarations and skipped general entities in attribute values cannot be reported, because the event would be out of sync with the reporting of the declarations or attribute values

    -
    +

    XML_SetUnknownEncodingHandler

    +
     void XMLCALL
     XML_SetUnknownEncodingHandler(XML_Parser p,
                                   XML_UnknownEncodingHandler enchandler,
    @@ -1576,7 +1640,7 @@ call to the function pointed at by convert. This function may return -1
     if the sequence itself is invalid. The convert pointer may be null if
     there are only single byte codes. The data parameter passed to the convert
     function is the data pointer from XML_Encoding. The
    -string s is NOT nul-terminated and points at the sequence of
    +string s is NOT null-terminated and points at the sequence of
     bytes to be converted.

    The function pointed at by release is called by the @@ -1584,7 +1648,8 @@ parser when it is finished with the encoding. It may be NULL.

    -
    +

    XML_SetStartNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetStartNamespaceDeclHandler(XML_Parser p,
     			         XML_StartNamespaceDeclHandler start);
    @@ -1602,7 +1667,8 @@ in that start tag.

    -
    +

    XML_SetEndNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetEndNamespaceDeclHandler(XML_Parser p,
     			       XML_EndNamespaceDeclHandler end);
    @@ -1619,7 +1685,8 @@ namespace was declared.

    -
    +

    XML_SetNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetNamespaceDeclHandler(XML_Parser p,
                                 XML_StartNamespaceDeclHandler start,
    @@ -1629,7 +1696,8 @@ XML_SetNamespaceDeclHandler(XML_Parser p,
     
    -
    +

    XML_SetXmlDeclHandler

    +
     void XMLCALL
     XML_SetXmlDeclHandler(XML_Parser p,
     		      XML_XmlDeclHandler xmldecl);
    @@ -1652,7 +1720,8 @@ that it was given as yes.

    -
    +

    XML_SetStartDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetStartDoctypeDeclHandler(XML_Parser p,
     			       XML_StartDoctypeDeclHandler start);
    @@ -1672,7 +1741,8 @@ will be non-zero if the DOCTYPE declaration has an internal subset.

    -
    +

    XML_SetEndDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetEndDoctypeDeclHandler(XML_Parser p,
     			     XML_EndDoctypeDeclHandler end);
    @@ -1686,7 +1756,8 @@ after parsing any external subset.

    -
    +

    XML_SetDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetDoctypeDeclHandler(XML_Parser p,
     			  XML_StartDoctypeDeclHandler start,
    @@ -1696,7 +1767,8 @@ XML_SetDoctypeDeclHandler(XML_Parser p,
     
    -
    +

    XML_SetElementDeclHandler

    +
     void XMLCALL
     XML_SetElementDeclHandler(XML_Parser p,
     			  XML_ElementDeclHandler eldecl);
    @@ -1768,7 +1840,8 @@ or sequence and children points to the nodes.

    -
    +

    XML_SetAttlistDeclHandler

    +
     void XMLCALL
     XML_SetAttlistDeclHandler(XML_Parser p,
                               XML_AttlistDeclHandler attdecl);
    @@ -1801,7 +1874,8 @@ in the dflt parameter.

    -
    +

    XML_SetEntityDeclHandler

    +
     void XMLCALL
     XML_SetEntityDeclHandler(XML_Parser p,
     			 XML_EntityDeclHandler handler);
    @@ -1835,7 +1909,8 @@ declarations.

    -
    +

    XML_GetCurrentByteIndex

    +
     XML_Index XMLCALL
     XML_GetCurrentByteIndex(XML_Parser p);
     
    @@ -1942,7 +2022,8 @@ the values returned by XML_GetCurrentColumnNumber. -
    +

    XML_GetCurrentLineNumber

    +
     XML_Size XMLCALL
     XML_GetCurrentLineNumber(XML_Parser p);
     
    @@ -1951,7 +2032,8 @@ Return the line number of the position. The first line is reported as 1. -
    +

    XML_GetCurrentColumnNumber

    +
     XML_Size XMLCALL
     XML_GetCurrentColumnNumber(XML_Parser p);
     
    @@ -1960,7 +2042,8 @@ Return the offset, from the beginning of the current line, of the position. -
    +

    XML_GetCurrentByteCount

    +
     int XMLCALL
     XML_GetCurrentByteCount(XML_Parser p);
     
    @@ -1972,7 +2055,8 @@ be used to distinguish empty-element tags from empty elements using separate start and end tags). -
    +

    XML_GetInputContext

    +
     const char * XMLCALL
     XML_GetInputContext(XML_Parser p,
                         int *offset,
    @@ -1998,12 +2082,105 @@ parse position may be before the beginning of the buffer.

    return NULL.

    +

    Billion Laughs Attack Protection

    + +

    The functions in this section configure the built-in + protection against various forms of + billion laughs attacks.

    + +

    XML_SetBillionLaughsAttackProtectionMaximumAmplification

    +
    +/* Added in Expat 2.4.0. */
    +XML_Bool XMLCALL
    +XML_SetBillionLaughsAttackProtectionMaximumAmplification(XML_Parser p,
    +                                                         float maximumAmplificationFactor);
    +
    +
    +

    + Sets the maximum tolerated amplification factor + for protection against + billion laughs attacks + (default: 100.0) + of parser p to maximumAmplificationFactor, and + returns XML_TRUE upon success and XML_FALSE upon error. +

    + + The amplification factor is calculated as .. +
    +    amplification := (direct + indirect) / direct
    +  
    + .. while parsing, whereas + direct is the number of bytes read from the primary document in parsing and + indirect is the number of bytes added by expanding entities and reading of external DTD files, combined. + +

    For a call to XML_SetBillionLaughsAttackProtectionMaximumAmplification to succeed:

    +
      +
    • parser p must be a non-NULL root parser (without any parent parsers) and
    • +
    • maximumAmplificationFactor must be non-NaN and greater than or equal to 1.0.
    • +
    + +

    + Note: + If you ever need to increase this value for non-attack payload, + please file a bug report. +

    + +

    + Note: + Peak amplifications + of factor 15,000 for the entire payload and + of factor 30,000 in the middle of parsing + have been observed with small benign files in practice. + + So if you do reduce the maximum allowed amplification, + please make sure that the activation threshold is still big enough + to not end up with undesired false positives (i.e. benign files being rejected). +

    +
    + +

    XML_SetBillionLaughsAttackProtectionActivationThreshold

    +
    +/* Added in Expat 2.4.0. */
    +XML_Bool XMLCALL
    +XML_SetBillionLaughsAttackProtectionActivationThreshold(XML_Parser p,
    +                                                        unsigned long long activationThresholdBytes);
    +
    +
    +

    + Sets number of output bytes (including amplification from entity expansion and reading DTD files) + needed to activate protection against + billion laughs attacks + (default: 8 MiB) + of parser p to activationThresholdBytes, and + returns XML_TRUE upon success and XML_FALSE upon error. +

    + +

    For a call to XML_SetBillionLaughsAttackProtectionActivationThreshold to succeed:

    +
      +
    • parser p must be a non-NULL root parser (without any parent parsers).
    • +
    + +

    + Note: + If you ever need to increase this value for non-attack payload, + please file a bug report. +

    + +

    + Note: + Activation thresholds below 4 MiB are known to break support for + DITA 1.3 payload + and are hence not recommended. +

    +
    +

    Miscellaneous functions

    The functions in this section either obtain state information from the parser or can be used to dynamically set parser options.

    -
    +

    XML_SetUserData

    +
     void XMLCALL
     XML_SetUserData(XML_Parser p,
                     void *userData);
    @@ -2018,7 +2195,8 @@ the memory associated with it, then you've probably just leaked
     memory.
     
     
    -
    +

    XML_GetUserData

    +
     void * XMLCALL
     XML_GetUserData(XML_Parser p);
     
    @@ -2027,7 +2205,8 @@ This returns the user data pointer that gets passed to handlers. It is actually implemented as a macro. -
    +

    XML_UseParserAsHandlerArg

    +
     void XMLCALL
     XML_UseParserAsHandlerArg(XML_Parser p);
     
    @@ -2038,7 +2217,8 @@ using the XML_GetUserData function. -
    +

    XML_SetBase

    +
     enum XML_Status XMLCALL
     XML_SetBase(XML_Parser p,
                 const XML_Char *base);
    @@ -2050,7 +2230,8 @@ there's no memory to store base, otherwise it's
     XML_STATUS_OK.
     
     
    -
    +

    XML_GetBase

    +
     const XML_Char * XMLCALL
     XML_GetBase(XML_Parser p);
     
    @@ -2058,7 +2239,8 @@ XML_GetBase(XML_Parser p); Return the base for resolving relative URIs. -
    +

    XML_GetSpecifiedAttributeCount

    +
     int XMLCALL
     XML_GetSpecifiedAttributeCount(XML_Parser p);
     
    @@ -2074,7 +2256,8 @@ call to a start handler. If called inside a start handler, then that means the current call. -
    +

    XML_GetIdAttributeIndex

    +
     int XMLCALL
     XML_GetIdAttributeIndex(XML_Parser p);
     
    @@ -2086,7 +2269,8 @@ attribute. If called inside a start handler, then that means the current call. -
    +

    XML_GetAttributeInfo

    +
     const XML_AttrInfo * XMLCALL
     XML_GetAttributeInfo(XML_Parser parser);
     
    @@ -2107,7 +2291,8 @@ as 1; thus the number of entries in the array is XML_GetSpecifiedAttributeCount(parser) / 2. -
    +

    XML_SetEncoding

    +
     enum XML_Status XMLCALL
     XML_SetEncoding(XML_Parser p,
                     const XML_Char *encoding);
    @@ -2122,7 +2307,8 @@ Returns XML_STATUS_OK on success or
     XML_STATUS_ERROR on error.
     
     
    -
    +

    XML_SetParamEntityParsing

    +
     int XMLCALL
     XML_SetParamEntityParsing(XML_Parser p,
                               enum XML_ParamEntityParsing code);
    @@ -2142,7 +2328,8 @@ The choices for code are:
     no effect and will always return 0.
     
     
    -
    +

    XML_SetHashSalt

    +
     int XMLCALL
     XML_SetHashSalt(XML_Parser p,
                     unsigned long hash_salt);
    @@ -2153,15 +2340,16 @@ Helps in preventing DoS attacks based on predicting hash
     function behavior. In order to have an effect this must be called
     before parsing has started. Returns 1 if successful, 0 when called
     after XML_Parse or XML_ParseBuffer.
    -

    Note:This call is optional, as the parser will auto-generate +

    Note: This call is optional, as the parser will auto-generate a new random salt value if no value has been set at the start of parsing.

    -

    Note:One should not call XML_SetHashSalt with a +

    Note: One should not call XML_SetHashSalt with a hash salt value of 0, as this value is used as sentinel value to indicate that XML_SetHashSalt has not been called. Consequently such a call will have no effect, even if it returns 1.

    -
    +

    XML_UseForeignDTD

    +
     enum XML_Error XMLCALL
     XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
     
    @@ -2198,7 +2386,8 @@ the document had a DTD with an external subset. This holds true even if the external entity reference handler returns without action.

    -
    +

    XML_SetReturnNSTriplet

    +
     void XMLCALL
     XML_SetReturnNSTriplet(XML_Parser parser,
                            int        do_nst);
    @@ -2220,7 +2409,8 @@ default manner, URI then local_name separated by the namespace
     separator.

    -
    +

    XML_DefaultCurrent

    +
     void XMLCALL
     XML_DefaultCurrent(XML_Parser parser);
     
    @@ -2234,7 +2424,8 @@ href="#XML_SetDefaultHandler" >XML_SetDefaultHandler or not a default handler. -
    +

    XML_ExpatVersion

    +
     XML_LChar * XMLCALL
     XML_ExpatVersion();
     
    @@ -2242,7 +2433,8 @@ XML_ExpatVersion(); Return the library version as a string (e.g. "expat_1.95.1"). -
    +

    XML_ExpatVersionInfo

    +
     struct XML_Expat_Version XMLCALL
     XML_ExpatVersionInfo();
     
    @@ -2266,7 +2458,8 @@ Testing these constants is currently the best way to determine if particular parts of the Expat API are available. -
    +

    XML_GetFeatureList

    +
     const XML_Feature * XMLCALL
     XML_GetFeatureList();
     
    @@ -2327,7 +2520,8 @@ time, the following features have been defined to have values:

    -
    +

    XML_FreeContentModel

    +
     void XMLCALL
     XML_FreeContentModel(XML_Parser parser, XML_Content *model);
     
    @@ -2346,7 +2540,8 @@ applications. This can be essential when using dynamically loaded libraries which use different C standard libraries (this can happen on Windows, at least).

    -
    +

    XML_MemMalloc

    +
     void * XMLCALL
     XML_MemMalloc(XML_Parser parser, size_t size);
     
    @@ -2358,7 +2553,8 @@ way must be freed using XML_MemFree. -
    +

    XML_MemRealloc

    +
     void * XMLCALL
     XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
     
    @@ -2377,7 +2573,8 @@ original block. Memory allocated in this way must be freed using >XML_MemFree. -
    +

    XML_MemFree

    +
     void XMLCALL
     XML_MemFree(XML_Parser parser, void *ptr);
     
    @@ -2388,9 +2585,12 @@ have been allocated by
    -

    Valid XHTML 1.0!

    + + + diff --git a/contrib/expat/doc/style.css b/contrib/expat/doc/style.css index 69df30bcecb2..1b8cd10dffa4 100644 --- a/contrib/expat/doc/style.css +++ b/contrib/expat/doc/style.css @@ -1,101 +1,47 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 2000 Clark Cooper + Copyright (c) 2000-2004 Fred L. Drake, Jr. + Copyright (c) 2021 Sebastian Pipping + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* Stop not using half the screen */ body { - background-color: white; - border: 0px; - margin: 0px; - padding: 0px; -} - -.corner { - width: 200px; - height: 80px; - text-align: center; -} - -.banner { - background-color: rgb(110,139,61); - color: rgb(255,236,176); - padding-left: 2em; -} - -.banner h1 { - font-size: 200%; -} - -.content { - padding: 0em 2em 1em 2em; -} - -.releaseno { - background-color: rgb(110,139,61); - color: rgb(255,236,176); - padding-bottom: 0.3em; - padding-top: 0.5em; - text-align: center; - font-weight: bold; -} - -.noborder { - border-width: 0px; -} - -.eg { - padding-left: 1em; - padding-top: .5em; - padding-bottom: .5em; - border: solid thin; - margin: 1em 0; - background-color: tan; - margin-left: 2em; - margin-right: 10%; -} - -.pseudocode { - padding-left: 1em; - padding-top: .5em; - padding-bottom: .5em; - border: solid thin; - margin: 1em 0; - background-color: rgb(250,220,180); - margin-left: 2em; - margin-right: 10%; -} - -.handler { - width: 100%; - border-top-width: thin; - margin-bottom: 1em; -} - -.handler p { - margin-left: 2em; -} - -.setter { - font-weight: bold; -} - -.signature { - color: navy; -} - -.fcndec { - width: 100%; - border-top-width: thin; - font-weight: bold; -} - -.fcndef { - margin-left: 2em; - margin-bottom: 2em; -} - -dd { - margin-bottom: 2em; + max-width: none; /* was: 80ch */ } .cpp-symbols dt { font-family: monospace; } -.cpp-symbols dd { - margin-bottom: 1em; + +/* Resemble style of