|
6053f1ff
|
2023-11-02T13:57:54
|
|
Remove redundant size check
The condition size > UINT_MAX - 10 is already checked earlier, so the
check is always false.
|
|
fbea03f3
|
2024-04-19T15:22:30
|
|
tree: Remove another redundant check in xmlDOMWrapCloneNode
The node type was already checked earlier.
|
|
6fadd798
|
2023-11-02T14:05:31
|
|
Remove always-false check old == cur
This case is already checked at the start of the function.
There it returns NULL, which seems more correct.
|
|
1a865567
|
2023-11-02T14:07:00
|
|
Remove redundant NULL check on cur
This variable is already NULL checked in the previous if condition.
|
|
27665200
|
2023-11-02T13:59:54
|
|
Remove redundant NULL check on cur
cur = node, and node cannot be NULL as it is checked at the start of the
function.
|
|
a0341ac8
|
2024-04-18T12:08:30
|
|
tree: Don't return empty localname in xmlSplitQName{2,3}
Match the behavior of xmlSplitQName and xmlSplitQName4.
|
|
f506ec66
|
2024-04-15T11:27:44
|
|
parser: Always decode entities in namespace URIs
Also decode entities in namespace URIs if entity substitution wasn't
requested. This should fix some corner cases when comparing namespace
URIs. The Namespaces in XML 1.0 spec says:
> In a namespace declaration, the URI reference is the normalized value
> of the attribute, so replacement of XML character and entity
> references has already been done before any comparison.
Make the serialization code escape special characters in namespace URIs
like in attribute values. This fixes serialization if entities were
substituted when parsing.
Fixes https://gitlab.gnome.org/GNOME/libxslt/-/issues/106
|
|
971ce404
|
2024-04-14T19:33:21
|
|
fuzz: Also set fuzzAllocFailed if a real allocation fails
Avoid false positives in real OOM situations.
|
|
20b0bd98
|
2024-04-09T18:00:13
|
|
fuzz: Account for quadratic runtime in xmlXPathTranslateFunction
Avoid fuzzer timeouts caused by this known issue.
|
|
fd8a3511
|
2024-04-09T16:54:02
|
|
error: Fix direct invocation of SAX error handlers
Revert part of commit c5a8aef2 to make it safe to call the default SAX
error handlers directly. This has been deprecated for a long time but
even xmllint still uses these handlers.
Should fix #713.
|
|
20fca2bb
|
2024-04-09T15:39:06
|
|
save: Report malloc failure in xmlAttrSerializeTxtContent
Flush buffer before checking for errors.
|
|
1f18d377
|
2024-04-02T23:19:28
|
|
fuzz: Add a few more comments
|
|
5bb84b47
|
2024-04-04T11:55:28
|
|
relaxng: Fix tree corruption in xmlRelaxNGParseNameClass
Don't create cycles in tree structure. This will lead to an infinite
loop or call stack overflow later.
Closes: https://gitlab.gnome.org/GNOME/libxml2/-/issues/711
|
|
16ccb61d
|
2024-04-05T13:19:56
|
|
xinclude: Don't try to fix base of non-elements
This would result in a spurious error.
|
|
af2bda4e
|
2024-04-05T13:09:45
|
|
SAX2: Also check URI length before resolving
We don't want to exceed the size limit of 1 MB in uri.c. Such errors
can't be distinguished from malloc failures.
|
|
5732ce56
|
2024-04-04T12:14:46
|
|
meson: Initial commit
|
|
650f842d
|
2024-04-02T15:25:28
|
|
string: Don't validate UTF-8 in xmlUTF8Strsub
Most string functions can assume valid UTF-8. In order to detect malloc
failures reliably, xmlUTF8Strsub should only return NULL if the start
index is out of bounds or a memory allocation failed.
|
|
86c27206
|
2024-04-02T14:41:15
|
|
save: Handle invalid parent pointers in xhtmlNodeDumpOutput
See #255 and commit 85b1792e.
|
|
f7f14537
|
2024-04-02T12:56:11
|
|
build: Disable support for compression libraries by default
libxml2 has limited support for reading and writing compressed data
with the help of zlib and liblzma which used to be enabled by default.
This only works for files read from the file system and never worked
with memory buffers. My guess is that this feature is virtually unused.
In light of the recently discovered xz backdoor, it's a good time to
disable these features by default to reduce attack surface and prepare
for eventual removal.
If --with-legacy is passed to the Autotools build, compression will
be enabled by default as before.
|
|
365976db
|
2024-03-30T17:17:21
|
|
xinclude: Don't use xmlHasNsProp
This function can malloc and doesn't report failures.
Another design mistake is that xmlUnsetNsProp requires an xmlNs
struct.
|
|
fe3cbf89
|
2024-03-29T14:54:39
|
|
fuzz: Check node type before xmlDocSetRootElement
|
|
5c553325
|
2024-03-29T13:45:19
|
|
Revert "tree: Only allow elements in xmlDocSetRootElement"
This reverts commit 4b698dbaec9bc6775fc8341ef8a3f0d8321f8548.
lxml assumes that xmlDocSetRootElement works with non-elements.
|
|
7c5daa37
|
2024-03-29T14:35:07
|
|
tree: Ignore namespace with NULL href in xmlSearchNs
Some users set href to NULL to unset a namespace without deleting it.
Also change the duplicate check in xmlNewNs which must agree with
xmlSearchNs.
Short-lived regression from f960c60d.
|
|
f43197fc
|
2024-03-29T11:16:45
|
|
tree: Don't coalesce text nodes in xmlAdd{Prev,Next}Sibling
Commit 9e1c72da from 2001 introduced a bug where xmlAddPrevSibling and
xmlAddNextSibling would only try to merge text nodes with one of its
new siblings. Commit 4ccd3eb8 fixed this bug but unfortunately, lxml
and possibly other downstream code depend on text nodes not being
merged.
To avoid breaking downstream code while still having somewhat
consistent API behavior, it's probably best to make these functions
never coalesce text nodes.
|
|
2cc7f710
|
2024-03-29T11:55:20
|
|
SAX2: Fix xmlSAX2EntityDecl with empty base
Short-lived regression.
|
|
730de88b
|
2024-03-28T15:42:02
|
|
SAX2: Optimize appending children
xmlSAX2AppendChild can make several assumptions which make appending
nodes more efficient. Also handle line numbers in xmlSAX2AppendChild.
|
|
2a713a80
|
2024-03-28T15:09:46
|
|
tree: Document behavior if xmlSetTreeDoc fails
|
|
f1e9c7bd
|
2024-03-28T14:54:18
|
|
tree: Optimize xmlInsertNode
Relink the node directly without calling xmlUnlinkNodeInternal.
|
|
ea0ee365
|
2024-03-28T12:38:43
|
|
tree: Align xmlAddChild with other node insertion functions
Make xmlAddChild unlink the child before insertion. Originally, linked
children would most likely cause tree corruption. The first fix
disallowed linked nodes, but there are cases where insertion of such
nodes could succeed.
Don't abort if the node is already a child of parent. In this case,
the node will be moved to the end of the child list.
|
|
e5cdb23f
|
2024-03-28T14:09:10
|
|
tree: Introduce xmlUnlinkNodeInternal
xmlUnlinkNode also removes references to DTD nodes which shouldn't be
done when moving nodes within a document. Introduce a new function
xmlUnlinkNodeInternal which only unlinks a node from the tree.
Remove references to DTD nodes in xmlNodeSetDoc. Note that moving
element and attribute declarations to another document will still leave
references in the source document.
|
|
1d50df87
|
2024-03-28T12:08:13
|
|
examples: Don't leave temp files
|
|
bfb02fbc
|
2024-03-28T11:30:05
|
|
fuzz: Fix xmlSetProp in API fuzzer
Finding the old attribute node is a bit more involved.
|
|
9bce9dbb
|
2024-03-26T14:30:57
|
|
valid: Report malloc failure in xmlValidateOneElement
|
|
887ad90a
|
2024-03-26T14:23:51
|
|
fuzz: Restrict input size of API fuzzer
|
|
6c5248e2
|
2024-03-26T14:21:47
|
|
fuzz: Restrict number of copies in API fuzzer
Avoid timeouts with large inputs.
|
|
aa04838e
|
2024-03-26T14:10:58
|
|
html: Use binary search in htmlEntityValueLookup
|
|
23a81841
|
2024-03-25T20:51:14
|
|
tree: Work on documentation
|
|
52efb20a
|
2024-03-24T13:43:25
|
|
fuzz: Enable float-divide-by-zero on OSS-Fuzz
This was recently disabled globally:
https://github.com/google/oss-fuzz/pull/11567
|
|
1ace0e85
|
2024-03-24T12:28:22
|
|
xinclude: Report malloc failure in xmlXIncludeAddNode
|
|
ad9a5637
|
2024-03-22T19:37:12
|
|
tree: Fix uninitialized value in xmlSearchNsSafe
Short-lived regression.
|
|
00c2f549
|
2024-03-22T18:45:31
|
|
ci: Support ASan in Docker container
Ubuntu now requires libclang-rt-dev for ASan libraries.
|
|
0e6e3921
|
2024-03-22T18:36:49
|
|
ci: Show config.log if configuration failed
|
|
c978a5d8
|
2024-03-22T18:34:12
|
|
ci: Remove Python 2 job, update C89 job
Python 2 isn't supported on newer Ubuntu releases. Newer Python
releases have header files which aren't compatible with C89.
|
|
3d6a25e5
|
2024-03-22T18:12:25
|
|
doc: Update Docker CI instructions
|
|
e7ff3ca4
|
2024-03-22T18:09:23
|
|
ci: Update Docker container to Ubuntu 23.10
This removes Python 2.
|
|
22455e97
|
2024-03-22T17:52:35
|
|
ci: Add meson to Docker container
|
|
d8741b81
|
2024-03-22T14:46:36
|
|
fuzz: Fix namespaces after xmlDOMWrapRemoveNode
|
|
05c147c3
|
2024-03-22T13:03:37
|
|
SAX2: Report malloc failure in xmlSAX2AttributeNs
|
|
0d04d79c
|
2024-03-22T12:26:28
|
|
xinclude: Report malloc failures in xmlXIncludeIncludeNode
|
|
7b316c11
|
2024-03-22T12:15:23
|
|
tree: Fix uninitialized value in xmlSearchNsByHrefSafe
Short-lived regression.
|
|
d4d1f3f3
|
2024-03-20T18:45:10
|
|
fuzz: Enable API fuzzer on OSS-Fuzz
|
|
5ea29703
|
2024-03-20T18:41:26
|
|
fuzz: Reorder API fuzzer ops
|
|
da32c852
|
2024-03-20T13:45:13
|
|
fuzz: Check text nodes after merging
Avoid exponential growth of text.
|
|
577e2516
|
2024-03-19T17:06:07
|
|
valid: Check for NULL node->name in xmlSnprintfElements
Unfortunately, we can have NULL element names if xmlSetTreeDoc fails.
|
|
a279aae3
|
2024-03-18T14:20:19
|
|
io: Allocate output buffer with XML_BUFFER_ALLOC_IO
This allows efficient shrinking of memory buffers.
Support IO buffers in xmlBufDetach.
|
|
072facc4
|
2024-03-18T14:17:57
|
|
encoding: Don't shrink input too early in xmlCharEncOutput
Some exotic encodings like ISO646-FR don't support '#' characters, so
encoding a character reference can actually fail. Don't skip the
offending input in this case so the error will be reported on the next
call.
|
|
3f05508a
|
2024-03-18T14:14:00
|
|
tree: Report malloc failures in attribute setters
|
|
3bdd0d7b
|
2024-03-18T12:12:15
|
|
xinclude: Set errNo in xmlXIncludeErrMemory
|
|
6a49bb77
|
2024-03-17T17:16:55
|
|
tree: Introduce xmlSearchNsSafe
After the failed experiment with a static XML namespace, introduce
versions of xmlSearchNs that report malloc failures.
Optimize the no-document case by only adding the XML namespace
declaration if it wasn't found in an ancestor.
|
|
047ea3ec
|
2024-03-17T16:23:31
|
|
Revert "tree: Allocate XML namespace statically"
This reverts commit 2840e33c5e4b51589a0b96e8102638eeaea6df72.
|
|
fb1e6302
|
2024-03-17T19:24:06
|
|
save: Check for NULL node->name in xhtmlIsEmpty
|
|
869f7244
|
2024-03-17T16:11:15
|
|
schemas: Fix ADD_ANNOTATION
Fix adding multiple annotations.
|
|
1b4bf22c
|
2024-03-17T15:05:42
|
|
xmlreader: Fix memory leak in xmlTextReaderFreeProp
Short-lived regression.
|
|
dc2a03d4
|
2024-03-16T14:50:56
|
|
valid: Deprecate internal validation functions
|
|
c0edd792
|
2024-03-16T15:10:32
|
|
fuzz: Move fuzzer options to environment variable
|
|
55175f75
|
2024-03-15T21:48:27
|
|
fuzz: Add OSS-Fuzz build.sh
Move build.sh to our repo to facilitate changes.
|
|
f14f089f
|
2024-03-15T21:04:04
|
|
fuzz: Add some comments in api.c
|
|
ee0c1f87
|
2024-02-29T14:51:49
|
|
fuzz: New tree API fuzzer
|
|
2469d5d0
|
2024-03-15T02:55:11
|
|
tree: Tighten source doc check in xmlDOMWrapAdoptNode
sourceDoc must match even if node->doc is NULL.
|
|
37556eb3
|
2024-03-14T16:32:58
|
|
tree: Check destParent->doc in xmlDOMWrapCloneNode
The document must match destDoc to avoid tree corruption.
|
|
7c48c01b
|
2024-03-13T12:42:43
|
|
tree: Switch to xmlNodeSetDoc in xmlDOMWrapAdoptNode
Report malloc failures.
Also fixes an issue where xmlDOMWrapAdoptAttr would descend into entity
references.
|
|
be2c26fb
|
2024-03-13T12:15:30
|
|
tree: Fix tree iteration in xmlDOMWrapRemoveNode
We didn't descend into elements having attributes.
|
|
4a90ce08
|
2024-03-12T22:30:43
|
|
tree: Don't abort early if malloc fails in DOM functions
If malloc fails halfway through updating a subtree, we must process the
rest of the tree to avoid tree corruption.
|
|
ad019ba1
|
2024-03-12T19:50:45
|
|
tree: Fix reallocation in xmlDOMWrapNSNormAddNsMapItem2
|
|
e321eba0
|
2024-03-12T17:42:28
|
|
tree: Set parent->last early in xmlDOMWrapCloneNode
Avoids a corrupted tree in error case.
|
|
84e6dc9e
|
2024-03-12T17:41:30
|
|
tree: Declare namespace on clone in xmlDOMWrapCloneNode
The new namespace must be declared on the cloned node, not the source
node.
|
|
09905670
|
2024-03-12T17:40:30
|
|
tree: Don't free linked DOM namespaces in error case
|
|
27f07f10
|
2024-03-12T16:49:10
|
|
tree: Report malloc failure in xmlDOMWrapCloneNode
Also don't store text content in dictionaries.
|
|
8d04f0ee
|
2024-03-11T20:44:47
|
|
tree: Refactor text node updates
|
|
4ccd3eb8
|
2024-03-11T19:43:56
|
|
tree: Refactor node insertion
Also fixes a text coalescing bug.
|
|
9f049afa
|
2024-03-11T15:57:14
|
|
tree: Refactor element creation and parsing of attribute values
Replace xmlStringGetNodeList and xmlStringLenGetNodeList with
xmlNodeParseContentInternal which also updates an optional parent
node.
Don't look up entities a second time via xmlNewReference.
|
|
9991fae4
|
2024-03-05T16:16:31
|
|
tree: Simplify xmlNodeGetContent, xmlBufGetNodeContent
Factor out xmlBufGetEntityRefContent and xmlBufGetChildContent.
Also allow entity declarations.
Optimize single text children.
Ignore missing or recursive entities silently.
Prefer xmlNodeGetContent over xmlNodeListGetString.
Check for entity cycles in xmlBufGetNodeContent.
Use children pointer of entity reference nodes if available to look up
entities.
|
|
05adfbf8
|
2024-03-11T13:42:15
|
|
buf: Don't use default buffer size for small strings
Detaching strings from a buffer with a default size of 4096 can waste
a lot of memory.
|
|
291a9d0f
|
2024-03-08T18:45:24
|
|
valid: Set document on dummmy element declaration
|
|
e3342f73
|
2024-03-07T17:47:06
|
|
tree: Work on documentation
|
|
aef1ff43
|
2024-03-06T19:30:43
|
|
string: Fix xmlStrncatNew(NULL, "")
This should return "" not NULL.
|
|
9033a270
|
2024-03-05T16:45:44
|
|
malloc-fail: Stop using xmlSplitQName2
This function doesn't report malloc failures.
|
|
b38f8eae
|
2024-03-05T14:55:15
|
|
malloc-fail: Report in xmlAddAttributeDecl
|
|
8677f547
|
2024-03-05T03:24:45
|
|
malloc-fail: Fix erroneous report in xmlNodeGetBaseSafe
|
|
9b3750c6
|
2024-03-04T03:49:23
|
|
malloc-fail: Avoid use-after-free in xmlAddChild
Returning NULL doesn't signal that the node was freed.
|
|
702f2e46
|
2024-03-04T01:39:34
|
|
malloc-fail: Fix memory leak in xmlNewNodeEatName
|
|
10c202f9
|
2024-03-04T01:31:12
|
|
malloc-fail: Check for NULL pointer in xmlSaveNotation*
|
|
9c2d451c
|
2024-03-04T01:25:46
|
|
malloc-fail: Fix use-after-free in xmlBufBackToBuffer
|
|
edbf1eb6
|
2024-03-05T18:07:13
|
|
entities: Don't allow null name in xmlNewEntity
|
|
50816b8d
|
2024-03-05T18:06:38
|
|
entities: Check for illegal entity types in xmlAddEntity
|
|
c1fe9e72
|
2024-03-06T15:21:49
|
|
io: Report more malloc failures when writing to output buffer
|
|
10c4ed1f
|
2024-03-06T14:14:33
|
|
html: Fix quadratic behavior in htmlNodeDump
Use an efficient buffer allocation scheme.
|
|
b1e75a91
|
2024-03-05T20:00:44
|
|
save: Report malloc failure in xmlAttrSerializeTxtContent
|
|
3494aa4f
|
2024-03-04T01:39:00
|
|
save: Cast return code of xmlBufNodeDump
Avoid implicit sign change.
|
|
1d392fab
|
2024-03-05T18:06:02
|
|
save: Check for output buffer errors
Report more error conditions.
|