Commit graph

4058 commits

Author SHA1 Message Date
Sebastian Pipping
7664ecdbae
Merge pull request #798 from libexpat/clang-tidy
Make GitHub Actions enforce clang-tidy clean code + address current clang-tidy warnings
2024-01-12 21:38:35 +01:00
Sebastian Pipping
f832f7b981 Make GitHub Actions enforce clang-tidy clean code 2024-01-12 17:26:50 +01:00
Sebastian Pipping
10cded2493 tests/basic_tests.c: Address clang-tidy warning clang-analyzer-core.NullDereference
clang-tidy output was:
> [..]/tests/basic_tests.c:2083:19: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
>  2083 |   errorFlags |= ((model[0].type == XML_CTYPE_SEQ) ? 0 : (1u << 2));
>       |                   ^~~~~~~~~~~~~
2024-01-12 17:25:27 +01:00
Sebastian Pipping
e23c300f25 tests/acc_tests.c: Address clang-tidy warning clang-analyzer-core.NonNullParamChecker
clang-tidy output was:
> [..]/tests/acc_tests.c:368:9: warning: Null pointer passed to 1st parameter expecting 'nonnull' [clang-analyzer-core.NonNullParamChecker]
>   368 |     if (strlen(printable) < (size_t)1)
>       |         ^      ~~~~~~~~~

Note: It was harmless because fail(..) right before catches that case.
2024-01-12 17:25:27 +01:00
Sebastian Pipping
0b424cb9ae examples/element_declarations.c: Simplify first call to stackPushMalloc
.. where stackTop is NULL anyway
2024-01-12 17:25:27 +01:00
Sebastian Pipping
0ebca2b10f examples/element_declarations.c: Fix memleak in dumpContentModel on OOM
clang-tidy output was:
> [..]/examples/element_declarations.c:163:16: warning: Potential leak of memory pointed to by 'stackTop' [clang-analyzer-unix.Malloc]
>   163 |         return false;
>       |                ^
2024-01-12 04:46:47 +01:00
Sebastian Pipping
716fd10bd4
Merge pull request #797 from catenacyber/fuzzcov
fuzz: improve coverage
2024-01-10 23:07:00 +01:00
Philippe Antoine
bb58abd4e0 fuzz: improve coverage 2024-01-10 22:06:37 +01:00
Sebastian Pipping
be47f6d5e8
Merge pull request #796 from libexpat/ci-control-flow-integrity
Make CI cover Clang's Control Flow Integrity sanitizer
2023-12-19 18:39:44 +01:00
Sebastian Pipping
64912b70fb
Merge pull request #795 from libexpat/autotools-install-shipped-xmlwf-manpage
Autotools: Make installation of shipped `doc/xmlwf.1` independent of docbook2man availability
2023-12-19 18:38:44 +01:00
Sebastian Pipping
18b44c980e linux.yml: Cover Clang's Control Flow Integrity sanitizer 2023-12-19 01:31:10 +01:00
Sebastian Pipping
9495cefd94 qa.sh: Fix dropping of QA_SANITIZER 2023-12-19 01:31:10 +01:00
Sebastian Pipping
4b878938bb qa.sh: Support Clang's Control Flow Integrity sanitizer
https://clang.llvm.org/docs/ControlFlowIntegrity.html
2023-12-19 01:31:10 +01:00
Sebastian Pipping
7384c88f9a configure.ac: Make installation of shipped doc/xmlwf.1 independent of docbook2man availability 2023-12-18 23:59:25 +01:00
Sebastian Pipping
822d1706b2
Merge pull request #794 from libexpat/dependabot/github_actions/actions/upload-artifact-4.0.0
Actions(deps): Bump actions/upload-artifact from 3.1.3 to 4.0.0
2023-12-18 17:48:34 +01:00
dependabot[bot]
8c87ca470d
Actions(deps): Bump actions/upload-artifact from 3.1.3 to 4.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.3 to 4.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](a8a3f3ad30...c7d193f32e)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 12:12:08 +00:00
Sebastian Pipping
b9fcca0aaa
Merge pull request #793 from libexpat/fix-bug-report-target
CMake|Autotools: Fix `PACKAGE_BUGREPORT` variable to something working
2023-12-17 23:09:46 +01:00
Sebastian Pipping
5a3c419e6a CMake|Autotools: Fix PACKAGE_BUGREPORT variable to something working 2023-12-17 03:34:27 +01:00
Sebastian Pipping
85ee77d31f
Merge pull request #792 from libexpat/autotools-sync-cmake-files
autotools: Sync CMake templates with CMake 3.26
2023-12-16 16:50:45 +01:00
Sebastian Pipping
141cdab714 autotools: Sync CMake templates with CMake 3.26 2023-12-15 05:02:23 +01:00
Sebastian Pipping
fb702e6c0e
Merge pull request #790 from libexpat/cmake-build-benchmark-also
CMake: Build `tests/benchmark/benchmark.c` for `EXPAT_BUILD_TESTS`
2023-11-22 13:04:23 +01:00
Sebastian Pipping
a55b7925b2 benchmark.c: Address MSVC warnings C4267 and C4244
Compiler output was:
> tests\benchmark\benchmark.c(102): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
> tests\benchmark\benchmark.c(117): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data
2023-11-21 21:42:50 +01:00
Sebastian Pipping
038040447e CMake: Build tests/benchmark/benchmark.c for EXPAT_BUILD_TESTS
.. like the Autotools build system does.
2023-11-21 20:27:24 +01:00
Sebastian Pipping
3588720613
Merge pull request #787 from libexpat/tests-more-chunk-size-coverage
tests: Migrate more tests to variable chunk size parsing
2023-11-13 15:21:37 +01:00
Sebastian Pipping
d2b31760cd tests: Simplify _XML_Parse_SINGLE_BYTES
Co-authored-by: Snild Dolkow <snild@sony.com>
2023-11-11 02:15:44 +01:00
Sebastian Pipping
3e5f6d6601 tests: Migrate more tests to variable chunk size parsing 2023-11-09 20:27:20 +01:00
Sebastian Pipping
795cf99922 tests: Make _XML_Parse_SINGLE_BYTES deny use with pathological input 2023-11-09 20:26:38 +01:00
Sebastian Pipping
df1e3d6f1e
Merge pull request #788 from SonyMobile/narrower-mingw-workaround
tests: Narrow test_buffer_can_grow_to_max mingw allocation workaround at compile time
2023-11-09 15:50:38 +01:00
Snild Dolkow
dcbc143680 tests: Narrow test_buffer_can_grow_to_max mingw allocation workaround
Instead of applying it to all less-than-64-bit platforms, let's narrow
the workaround to just the known failure: 32-bit mingw.
2023-11-09 10:46:51 +01:00
Sebastian Pipping
3a0c5d6ae5
Merge pull request #777 from libexpat/xml-dtd-undefined
Fix issues for compilation with XML_DTD undefined
2023-11-08 14:05:03 +01:00
Sebastian Pipping
d11ed9fa48
Merge pull request #786 from libexpat/tests-nan-and-infinity
tests: Use NAN and INFINITY of C99 and C++11
2023-11-07 16:37:38 +01:00
Sebastian Pipping
9411ac625b tests: Use NAN and INFINITY of C99 and C++11
Effectively reverts commit f6f5d9bb4c.
2023-11-07 14:22:31 +01:00
Sebastian Pipping
8a6c61de4a lib: Add XML_GE to XML_GetFeatureList and XML_FeatureEnum
Co-authored-by: Snild Dolkow <snild@sony.com>
2023-11-07 13:00:42 +01:00
clang-format
ac14808b26 Mass-apply clang-format 17.0.3 using ./apply-clang-format.sh 2023-11-07 13:00:42 +01:00
Sebastian Pipping
55fecd6aa4 Drop redundant "XML_GE == 1" guards
These are redundant because further out there is a guard
for "XML_GE == 1" already.  In the visual world, the pattern
is this:

> #if XML_GE == 1
> [..]
> #  if XML_GE == 1
> [..]
> #  endif
> [..]
> #endif

Spotted by Snild Dolkow, thanks!

Co-authored-by: Snild Dolkow <snild@sony.com>
2023-11-07 13:00:42 +01:00
Sebastian Pipping
caa2719863 Simplify "defined(XML_DTD) || XML_GE == 1" to "XML_GE == 1" 2023-11-07 13:00:42 +01:00
Sebastian Pipping
2848dc4e70 Simplify "! defined(XML_DTD) && XML_GE == 0" to "XML_GE == 0" 2023-11-07 13:00:42 +01:00
Sebastian Pipping
e3aaa06cdf linux.yml: Add a dedicated run for -DEXPAT_GE=OFF 2023-11-07 13:00:42 +01:00
Sebastian Pipping
d269f90975 coverage.sh: Cover XML_DTD undefined (with and without XML_GE) 2023-11-07 13:00:42 +01:00
Sebastian Pipping
cdead241d4 doc/reference.html: Clarify effect of XML_DTD on external entities
Defining XML_DTD emnables support for external parameter(!)
entities.  External general(!) entities have been supported
even with XML_DTD undefined.  (Only now with Expat 2.6.0
defining XML_GE as 0 can take that away.)
2023-11-07 13:00:42 +01:00
Sebastian Pipping
d3f7bbd37b doc/reference.html: Document build time macro XML_GE 2023-11-07 13:00:42 +01:00
Sebastian Pipping
2f18bacfcd tests: Cover and adjust to XML_GE==0 self-references 2023-11-07 13:00:42 +01:00
Sebastian Pipping
2b127c20b2 lib: Make XML_GE==0 use self-references as entity replacement text 2023-11-06 21:02:42 +01:00
Sebastian Pipping
7767efe1aa tests/handlers.c: Make accumulate_entity_decl robust towards value==NULL 2023-11-06 21:02:42 +01:00
Sebastian Pipping
b0975cb73a lib: Fail the build if XML_GE is not set to 1 or 0 2023-11-06 20:43:09 +01:00
Sebastian Pipping
00089ed745 tests: Fix tests for XML_GE==0 + broaden for XML_GE==1 2023-11-06 20:43:09 +01:00
Sebastian Pipping
0f075ec8ec lib|xmlwf|cmake: Extend scope of billion laughs attack protection
.. from "defined(XML_DTD)" to "defined(XML_DTD) || XML_GE==1".
2023-11-06 20:43:09 +01:00
Sebastian Pipping
ed87a47934 configure.ac: Define macro XML_GE as 1 2023-11-06 20:43:09 +01:00
Sebastian Pipping
daa89e42c0 cmake: Introduce option EXPAT_GE to control macro XML_GE 2023-11-06 20:43:09 +01:00
Sebastian Pipping
d285fafaca
Merge pull request #785 from libexpat/fix-dll-version-info
win32|cmake: Fix FileVersion and ProductVersion in DLL version info
2023-11-04 00:20:34 +01:00