1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00
Commit Graph

351 Commits

Author SHA1 Message Date
Nick Wellnhofer
c5b45fbc07 doc: Misc fixes 2025-05-16 19:04:20 +02:00
Nick Wellnhofer
adfbeb7e08 doc: Stop using *Ptr typedefs in documentation 2025-05-16 18:03:12 +02:00
Nick Wellnhofer
a40f36e7f2 include: Stop using *Ptr typedefs in public headers 2025-05-16 18:03:12 +02:00
Nick Wellnhofer
9bbffec568 doc: Move brief to top, params to bottom of doc comments 2025-05-06 19:51:38 +02:00
Nick Wellnhofer
81ac2e27fd doc: Misc fixes to valid docs 2025-05-06 19:51:38 +02:00
Nick Wellnhofer
2c150e62f5 doc: Formatting fixes 2025-05-02 20:21:39 +02:00
Nick Wellnhofer
cb1635a642 doc: Use @since command 2025-05-02 19:05:25 +02:00
Nick Wellnhofer
e78e05c990 doc: Fix autolinks to functions
Unfortunately, autolinks in .c files aren't converted by Doxygen for
some reason.
2025-05-02 17:45:31 +02:00
Nick Wellnhofer
f7c412874b doc: Remove more comment block headers 2025-05-02 17:41:26 +02:00
Nick Wellnhofer
e525564f65 doc: Remove empty lines at start of block
These lines were left over after automatic conversion.
2025-05-02 11:42:05 +02:00
Nick Wellnhofer
e549622bc5 doc: Convert documentation to Doxygen
Automated conversion based on a few regexes.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
69879da88f doc: Remove email addresses from documentation
Also remove authorship information from generated files, hash.c and
globals.c which were rewritten.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
61890e399d doc: Prepare for conversion to Doxygen
Fix many params in internal functions (not really necessary but Doxygen
warns about that in XML mode).

Fix formatting in a few corner cases that automatic conversion can't
handle.

Rearrange some DOC_DISABLE blocks.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
6896f478d4 Revert "valid: Remove duplicate error messages when streaming"
This reverts commit cd220b93d8.

This commit broke the xmstarlet tests.
2025-04-18 17:24:45 +02:00
Nick Wellnhofer
63dfcca670 fuzz: Reduce initial array size 2025-02-20 12:22:12 +01:00
Nick Wellnhofer
8c8753ad52 [CVE-2025-24928] Fix stack-buffer-overflow in xmlSnprintfElements
Fixes #847.
2025-02-18 15:07:51 +01:00
Zak Ridouh
b466e70ae5 Fix early return in vstateVPush in valid.c
While looking over the code in the fallback method for `vstateVPush` in
valid.c when `LIBXML_REGEXP_ENABLED` is not defined, I noticed that
there is an ungated `return(-1)` after attempting to allocate memory.

I believe this should be inside a check, for if the malloc fails.
2025-02-05 14:11:04 -08:00
Nick Wellnhofer
71c37a565d malloc-fail: Fix memory leak in xmlValidateElementContent 2024-12-30 11:42:40 +01:00
Nick Wellnhofer
cd220b93d8 valid: Remove duplicate error messages when streaming 2024-12-28 11:55:24 +01:00
Nick Wellnhofer
bd2a16489f valid: Fix build --without-regexps 2024-12-28 11:55:24 +01:00
Nick Wellnhofer
2e3a91a766 doc: Fix documentation 2024-12-26 21:05:39 +01:00
Nick Wellnhofer
0d4a17af49 valid: Fix and check return value of nodeVPush 2024-12-21 19:41:44 +01:00
Nick Wellnhofer
178b11219c valid: Check reallocations for overflow 2024-12-21 19:37:38 +01:00
Nick Wellnhofer
5204c872bb valid: Reset context before validating
Reset last error and "stopped" flag. Otherwise new errors could be
ignored.
2024-11-26 14:30:54 +01:00
Nick Wellnhofer
4d1f35b0a9 valid: Deprecate more internal functions 2024-11-19 00:03:37 +01:00
Nick Wellnhofer
5a51f08517 valid: Implement xmlCtxtValidateDocument
This allows to use the error handler or resource loader of a parser
context.
2024-11-19 00:03:37 +01:00
Nick Wellnhofer
1e1731a43d valid: Add NULL check in xmlCtxtValidateDtd 2024-11-17 13:20:06 +01:00
Nick Wellnhofer
7f8c436c75 parser: Implement xmlCtxtParseDtd and xmlCtxtValidateDtd
This allows to use the context's error handler, options and other
settings.

Fixes #808.
2024-11-15 16:30:52 +01:00
Nick Wellnhofer
0c56eb8215 tree: Restore return value of xmlNodeListGetString with NULL list
When passing a NULL list to xmlNodeListGetString or
xmlNodeListGetRawString, return NULL instead of "" to match the old
behavior.

Fixes #783.
2024-08-12 21:38:50 +02:00
Nick Wellnhofer
6be79014d7 Remove unused code 2024-07-15 16:33:38 +02:00
Nick Wellnhofer
842a044831 valid: Restore ID lookup
Revert a change from d025cfbb and don't overwrite ID table entries, so
that the first attribute will be returned if there are duplicate IDs.

This requires two other changes:

- Attributes in entity content are never added to the ID table. This
  seems reasonable.

- Remove the optimization to skip ID lookup when copying and the target
  document has an empty ID table. This also seems more correct since the
  document could have ID declarations nevertheless or we could be
  copying xml:ids into the document for the first time.

Fixes #757.
2024-07-03 11:46:06 +02:00
Rosen Penev
2def7b4b28 clang-tidy: move assignments out of if
Found with bugprone-assignment-in-if-condition

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-20 21:11:44 -07:00
Rosen Penev
217e9b7af2 clang-tidy: don't return in void functions
Found with readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-20 20:37:34 +00:00
Nick Wellnhofer
1b6403583b schemas: Stop using xmlValidateNotationUse
Simplify symbol availability logic.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
b0fc67aa22 build: Remove --with-tree configuration option
This option would allow for a smaller, but mostly useless minimal build.
But it complicates the symbol availability logic in an insane way and
requires specialized tools like our custom C parser in doc/apibuild.py.

See #717.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
11cd18d879 valid: Check return value of xmlValidBuildAContentModel
Fixes return code in case of malloc failure.
2024-05-31 13:31:09 +02:00
Nick Wellnhofer
e75e878e02 doc: Update and fix documentation 2024-05-20 14:23:39 +02:00
Nick Wellnhofer
0651ad667c valid: Report malloc failure after xmlRegExecPushString 2024-05-13 13:08:14 +02:00
Nick Wellnhofer
9bce9dbb19 valid: Report malloc failure in xmlValidateOneElement 2024-03-26 14:30:57 +01:00
Nick Wellnhofer
577e2516d0 valid: Check for NULL node->name in xmlSnprintfElements
Unfortunately, we can have NULL element names if xmlSetTreeDoc fails.
2024-03-19 17:06:07 +01:00
Nick Wellnhofer
dc2a03d482 valid: Deprecate internal validation functions 2024-03-16 15:20:08 +01:00
Nick Wellnhofer
291a9d0f81 valid: Set document on dummmy element declaration 2024-03-15 19:47:08 +01:00
Nick Wellnhofer
9033a27068 malloc-fail: Stop using xmlSplitQName2
This function doesn't report malloc failures.
2024-03-15 19:47:08 +01:00
Nick Wellnhofer
b38f8eae07 malloc-fail: Report in xmlAddAttributeDecl 2024-03-15 19:47:08 +01:00
Nick Wellnhofer
3061b56a1e valid: Check for NULL text content in xmlValidateOneElement
Shouldn't occur in parsed documents but you can create text nodes with
NULL content through the API.
2024-03-15 19:47:08 +01:00
Nick Wellnhofer
af3d80b9a0 valid: Check for elem->name in xmlIsID
elem->name can be NULL is xmlNodeSetDoc failed.
2024-03-15 19:47:08 +01:00
Nick Wellnhofer
1233805dcb valid: Fix some return codes after errors 2024-03-15 19:47:08 +01:00
Nick Wellnhofer
04c691f7ea valid: Eliminate xmlCtxtGetDtdElementDesc
Improves malloca failure reporting without parser context.
2024-03-15 19:47:08 +01:00
Nick Wellnhofer
ab345338a4 valid: Report malloc failure in legacy DTD serialization 2024-03-15 19:47:08 +01:00
Nick Wellnhofer
264b283c27 valid: Fix hash removal in xmlRemoveRef
Don't create a NULL entry.
2024-03-15 19:47:08 +01:00