Rosen Penev
bc288124f3
[clang-tidy] replace 0/nullptr with macro
...
Found with modernize-use-nullptr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:19:29 -07:00
Rosen Penev
104765367b
[clang-tidy] use C++ headers
...
Found with modernize-deprecated-headers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:01:37 -07:00
Rosen Penev
14a6df861f
[clang-tidy] sort includes alphabetically
...
Found with llvm-include-order
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:01:37 -07:00
Rosen Penev
88b0d74bad
[clang-tidy] add ending namespace comments
...
Found with google-readability-namespace-comments
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:01:37 -07:00
Rosen Penev
dbf2b7d24c
[clang-tidy] change function parameter to const
...
Found with readability-non-const-parameter
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:01:37 -07:00
Rosen Penev
dcbcd50c31
[clang-tidy] use () in macros
...
Found with bugprone-macro-parentheses
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:01:37 -07:00
Rosen Penev
65ae9ee068
[clang-tidy] use uppercase literals
...
Found with readability-uppercase-literal-suffix
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:01:37 -07:00
Rosen Penev
49036094e0
[clang-tidy] fix inconsistent declarations
...
Found with readability-inconsistent-declaration-parameter-name
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 16:01:37 -07:00
Arseny Kapoulkine
5c4225b5c9
tests: Fix wchar_t build
2021-05-11 23:22:13 -07:00
Arseny Kapoulkine
8cece4b9fe
Fix a bug in move construction when move source is empty
...
Previously when copying the allocator state we would copy an incorrect
root pointer into the document's current state; while this had a minimal
impact on the allocation state due to the fact that any new allocation
would need to create a new page, this used a potentially stale field of
the moved document when setting up new pages, which could create issues
in future uses of the pages.
This change fixes the core problem and also removes the use of the
_root->allocator from allocate_page since it's not clear why we need it
there in the first place.
2021-05-11 22:53:54 -07:00
Arseny Kapoulkine
56c9afa7c8
XPath: Improve recursion limit for deep chains of //
...
Since foo//bar//baz adds two nodes for each //, we need to increment the
depth by 2 on each iteration to limit the AST correctly.
Fixes the stack overflow found by cluster-fuzz (I suspect the issue
there is a bit deeper, but this part is definitely a bug and as such I'd
rather wait for the next test case for now).
2021-05-11 22:27:53 -07:00
Arseny Kapoulkine
791971ee59
Merge pull request #422 from neheb/patch-1
...
fix cygwin compilation
2021-05-07 00:35:47 -07:00
Rosen Penev
e672b1c9f0
fix cygwin compilation
2021-05-06 23:25:29 -07:00
Arseny Kapoulkine
5df537f348
Merge pull request #419 from neheb/ranges
...
add empty method
2021-04-27 23:37:06 -07:00
Rosen Penev
c167259e60
add empty method
...
Simple and allows to avoid using std::distance.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-27 13:55:02 -07:00
Arseny Kapoulkine
5d58e94b6d
Merge pull request #418 from neheb/ranges
...
remove const from xml_node_iterator ++/--
Fixes #417 .
2021-04-26 14:32:51 -07:00
Rosen Penev
ef257796db
remove const from operator++/--
...
This prevents usage with C++20 ranges since it does not satisfy
std::weakly_incrementable.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-26 14:06:19 -07:00
Arseny Kapoulkine
08b3433180
Merge pull request #394 from zeux/cmake-yay
...
Don't define pugixml import target if it already exists
2020-12-22 08:41:08 -08:00
Arseny Kapoulkine
06868c8f57
Don't define pugixml import target if it already exists
...
This fixes duplicate target definition errors when find_package(pugixml)
is called twice in a build.
Fixes #393 .
2020-12-22 08:15:11 -08:00
Arseny Kapoulkine
0e3f1699ff
Merge pull request #391 from zeux/cmake-omg
...
Fix compatibility issue with CMake 3.10
2020-12-18 09:52:06 -08:00
Arseny Kapoulkine
e2bc4f4af2
Fix compatibility issue with CMake 3.10
...
target_link_libraries/INTERFACE doesn't seem to work on CMake 3.10, but
directly setting the property does work.
Fixes #390 .
2020-12-18 09:07:44 -08:00
Arseny Kapoulkine
907955280f
Merge pull request #389 from mathstuf/fix-alias-compat-target
...
cmake: avoid ALIAS target
2020-12-14 19:47:56 -08:00
Ben Boeckel
4feab60bb7
cmake: avoid ALIAS target
...
This is not allowed on IMPORTED targets.
2020-12-10 12:02:01 -05:00
Arseny Kapoulkine
5a0fd5d85f
docs: Rebuild HTML documentation
2020-12-04 16:31:20 -08:00
Arseny Kapoulkine
68a92aa972
Merge pull request #384 from mathstuf/update-1.11-release-notes
...
Update 1.11 release notes
2020-12-04 15:59:40 -08:00
Ben Boeckel
d1d415e666
docs: add a note about the new imported target name for CMake
2020-12-02 17:17:21 -05:00
Ben Boeckel
5063e87499
cmake: provide a compatibility target for users
...
For users using older pugixml releases, add an ALIAS target which works
with the new versions too.
2020-12-02 17:16:47 -05:00
Arseny Kapoulkine
7a9da11d8b
scripts: Convert archive.py to Python 3
...
The changes are mostly mechanically converting str to bytes.
2020-11-26 01:08:07 -08:00
Arseny Kapoulkine
a3ae05cc9f
scripts: Remove deprecated iconUrl from NuGet package
...
The logo.svg link is dead anyway.
2020-11-26 01:01:57 -08:00
Arseny Kapoulkine
fe4bc946b2
Update copyright year to 2020 everywhere
2020-11-26 01:00:27 -08:00
Arseny Kapoulkine
632c042a35
Merge pull request #383 from zeux/next-release
...
Update version to 1.11 and update documentation
2020-11-25 14:37:35 -08:00
Arseny Kapoulkine
70bd6a6b0a
Update version to 1.11 and update documentation
2020-11-25 10:18:42 -08:00
Arseny Kapoulkine
8afc1239a3
tests: Fix test fallout for MSVC6
...
One more XPath test falls prey to MSVC6 NaN comparison codegen issues.
2020-11-25 09:48:19 -08:00
Arseny Kapoulkine
5f97d5d66f
Fix -Wshadow in remove_children()
...
child variable was shadowing xml_node::child
2020-11-25 09:28:26 -08:00
Arseny Kapoulkine
28aebf2b22
Merge pull request #382 from zeux/TheNicker-master
...
Fix MSVC deprecation warnings when using clang-cl
2020-11-25 09:19:24 -08:00
Arseny Kapoulkine
df42668e18
Cleanup code and feature detection
...
We now use open_file similarly to open_file_wide, and activate the
workaround for MSVC 2005+ since that's when the _s versions were added
in the first place.
2020-11-25 08:38:22 -08:00
Arseny Kapoulkine
30761e48df
Merge pull request #376 from jjmccollum/mingw-dll-fix
...
Added fix to pugixml_dll.rc so shared lib can be built with MinGW
2020-10-26 15:48:58 -07:00
James McCollum
24e454066d
Added fix to pugixml_dll.rc so shared lib can be built with MinGW
2020-10-26 08:17:46 -04:00
Arseny Kapoulkine
c4bae8d818
Merge pull request #370 from zeux/xpath-rec
...
XPath: Fix stack overflow in functions with long argument lists
2020-09-11 13:06:44 -07:00
Arseny Kapoulkine
8e5b8e0f46
XPath: Fix stack overflow in functions with long argument lists
...
Function call arguments are stored in a list which is processed
recursively during optimize(). We now limit the depth of this construct
as well to make sure optimize() doesn't run out of stack space.
2020-09-11 09:50:41 -07:00
Arseny Kapoulkine
a3fad540a7
Merge pull request #369 from zeux/xpath-rec
...
XPath: Restrict AST depth to prevent stack overflow
2020-09-10 09:53:25 -07:00
Arseny Kapoulkine
20aef1cd4b
Fix stack overflow in tests on MSVC x64
...
The default stack on MSVC/x64/debug is sufficient for 1692 nested
invocations only, whereas on clang/linux it's ~8K...
For now set the limit to be conservative.
2020-09-10 09:11:46 -07:00
Arseny Kapoulkine
c7090e6c33
Fix tests in wchar mode
2020-09-10 01:07:48 -07:00
Arseny Kapoulkine
1f84db837b
XPath: Restrict AST depth to prevent stack overflow
...
XPath parser and execution engine isn't stackless; the depth of the
query controls the amount of C stack space required.
This change instruments places in the parser where the control flow can
recurse, requiring too much C stack space to produce an AST, or where a
stackless parse is used to produce arbitrarily deep AST which will
create issues for downstream processing.
As a result XPath parser should now be fuzz safe for malicious inputs.
2020-09-10 00:55:26 -07:00
Lior Lahav
c258fba6f1
Replaced fopen and _wfopen deprecated functions with the safer fopen_s and _wfopen_s
2020-07-21 22:37:16 +03:00
Arseny Kapoulkine
22401bafaf
Merge pull request #363 from c72578/2020-07-15_Fix_pkgconfig_lib_postfix
...
Fix debug postfix in pkgconfig file
2020-07-15 14:05:14 -07:00
Wolfgang Stöggl
8b074b171f
Fix debug postfix in pkgconfig file
...
In case of USE_POSTFIX, the POSTFIX is dependent
on the CMAKE_BUILD_TYPE.
Use the correct POSTFIX also in the generated pugixml.pc file.
This results in the following contents of pugixml.pc:
- Release:
Libs: -L${libdir} -lpugixml
- RelWithDebInfo
Libs: -L${libdir} -lpugixml_r
- MinSizeRel:
Libs: -L${libdir} -lpugixml_m
- Debug:
Libs: -L${libdir} -lpugixml_d
2020-07-15 21:59:05 +02:00
Arseny Kapoulkine
d58115e581
Merge pull request #360 from julianxhokaxhiu/patch-1
...
[Cmake] Static build should not export APIs
2020-07-06 09:22:06 -07:00
Arseny Kapoulkine
45271c9c9c
Merge pull request #361 from zeux/ps-stderr
...
Fix PowerShell errors on stderr
2020-07-06 09:21:46 -07:00
Arseny Kapoulkine
f08768d9bf
Fix PowerShell errors on stderr
...
PS invocation of code coverage upload gets triggered because of stderr
output from curl with progress report when uploading coverage.
2020-07-06 08:32:24 -07:00