Log

Author Commit Date CI Message
Nick Wellnhofer 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.
Nick Wellnhofer 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.
Nick Wellnhofer 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.
Nick Wellnhofer 2cc7f710 2024-03-29T11:55:20 SAX2: Fix xmlSAX2EntityDecl with empty base Short-lived regression.
Nick Wellnhofer 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.
Nick Wellnhofer 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.
Nick Wellnhofer 2a713a80 2024-03-28T15:09:46 tree: Document behavior if xmlSetTreeDoc fails
Nick Wellnhofer f1e9c7bd 2024-03-28T14:54:18 tree: Optimize xmlInsertNode Relink the node directly without calling xmlUnlinkNodeInternal.
Nick Wellnhofer 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.
Nick Wellnhofer 1d50df87 2024-03-28T12:08:13 examples: Don't leave temp files
Nick Wellnhofer bfb02fbc 2024-03-28T11:30:05 fuzz: Fix xmlSetProp in API fuzzer Finding the old attribute node is a bit more involved.
Nick Wellnhofer 9bce9dbb 2024-03-26T14:30:57 valid: Report malloc failure in xmlValidateOneElement
Nick Wellnhofer 887ad90a 2024-03-26T14:23:51 fuzz: Restrict input size of API fuzzer
Nick Wellnhofer 6c5248e2 2024-03-26T14:21:47 fuzz: Restrict number of copies in API fuzzer Avoid timeouts with large inputs.
Nick Wellnhofer aa04838e 2024-03-26T14:10:58 html: Use binary search in htmlEntityValueLookup
Nick Wellnhofer 23a81841 2024-03-25T20:51:14 tree: Work on documentation
Nick Wellnhofer 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
Nick Wellnhofer 1ace0e85 2024-03-24T12:28:22 xinclude: Report malloc failure in xmlXIncludeAddNode
Nick Wellnhofer ad9a5637 2024-03-22T19:37:12 tree: Fix uninitialized value in xmlSearchNsSafe Short-lived regression.
Nick Wellnhofer 00c2f549 2024-03-22T18:45:31 ci: Support ASan in Docker container Ubuntu now requires libclang-rt-dev for ASan libraries.
Nick Wellnhofer 0e6e3921 2024-03-22T18:36:49 ci: Show config.log if configuration failed
Nick Wellnhofer 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.
Nick Wellnhofer 3d6a25e5 2024-03-22T18:12:25 doc: Update Docker CI instructions
Nick Wellnhofer e7ff3ca4 2024-03-22T18:09:23 ci: Update Docker container to Ubuntu 23.10 This removes Python 2.
Nick Wellnhofer 22455e97 2024-03-22T17:52:35 ci: Add meson to Docker container
Nick Wellnhofer d8741b81 2024-03-22T14:46:36 fuzz: Fix namespaces after xmlDOMWrapRemoveNode
Nick Wellnhofer 05c147c3 2024-03-22T13:03:37 SAX2: Report malloc failure in xmlSAX2AttributeNs
Nick Wellnhofer 0d04d79c 2024-03-22T12:26:28 xinclude: Report malloc failures in xmlXIncludeIncludeNode
Nick Wellnhofer 7b316c11 2024-03-22T12:15:23 tree: Fix uninitialized value in xmlSearchNsByHrefSafe Short-lived regression.
Nick Wellnhofer d4d1f3f3 2024-03-20T18:45:10 fuzz: Enable API fuzzer on OSS-Fuzz
Nick Wellnhofer 5ea29703 2024-03-20T18:41:26 fuzz: Reorder API fuzzer ops
Nick Wellnhofer da32c852 2024-03-20T13:45:13 fuzz: Check text nodes after merging Avoid exponential growth of text.
Nick Wellnhofer 577e2516 2024-03-19T17:06:07 valid: Check for NULL node->name in xmlSnprintfElements Unfortunately, we can have NULL element names if xmlSetTreeDoc fails.
Nick Wellnhofer 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.
Nick Wellnhofer 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.
Nick Wellnhofer 3f05508a 2024-03-18T14:14:00 tree: Report malloc failures in attribute setters
Nick Wellnhofer 3bdd0d7b 2024-03-18T12:12:15 xinclude: Set errNo in xmlXIncludeErrMemory
Nick Wellnhofer 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.
Nick Wellnhofer 047ea3ec 2024-03-17T16:23:31 Revert "tree: Allocate XML namespace statically" This reverts commit 2840e33c5e4b51589a0b96e8102638eeaea6df72.
Nick Wellnhofer fb1e6302 2024-03-17T19:24:06 save: Check for NULL node->name in xhtmlIsEmpty
Nick Wellnhofer 869f7244 2024-03-17T16:11:15 schemas: Fix ADD_ANNOTATION Fix adding multiple annotations.
Nick Wellnhofer 1b4bf22c 2024-03-17T15:05:42 xmlreader: Fix memory leak in xmlTextReaderFreeProp Short-lived regression.
Nick Wellnhofer dc2a03d4 2024-03-16T14:50:56 valid: Deprecate internal validation functions
Nick Wellnhofer c0edd792 2024-03-16T15:10:32 fuzz: Move fuzzer options to environment variable
Nick Wellnhofer 55175f75 2024-03-15T21:48:27 fuzz: Add OSS-Fuzz build.sh Move build.sh to our repo to facilitate changes.
Nick Wellnhofer f14f089f 2024-03-15T21:04:04 fuzz: Add some comments in api.c
Nick Wellnhofer ee0c1f87 2024-02-29T14:51:49 fuzz: New tree API fuzzer
Nick Wellnhofer 2469d5d0 2024-03-15T02:55:11 tree: Tighten source doc check in xmlDOMWrapAdoptNode sourceDoc must match even if node->doc is NULL.
Nick Wellnhofer 37556eb3 2024-03-14T16:32:58 tree: Check destParent->doc in xmlDOMWrapCloneNode The document must match destDoc to avoid tree corruption.
Nick Wellnhofer 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.
Nick Wellnhofer be2c26fb 2024-03-13T12:15:30 tree: Fix tree iteration in xmlDOMWrapRemoveNode We didn't descend into elements having attributes.
Nick Wellnhofer 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.
Nick Wellnhofer ad019ba1 2024-03-12T19:50:45 tree: Fix reallocation in xmlDOMWrapNSNormAddNsMapItem2
Nick Wellnhofer e321eba0 2024-03-12T17:42:28 tree: Set parent->last early in xmlDOMWrapCloneNode Avoids a corrupted tree in error case.
Nick Wellnhofer 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.
Nick Wellnhofer 09905670 2024-03-12T17:40:30 tree: Don't free linked DOM namespaces in error case
Nick Wellnhofer 27f07f10 2024-03-12T16:49:10 tree: Report malloc failure in xmlDOMWrapCloneNode Also don't store text content in dictionaries.
Nick Wellnhofer 8d04f0ee 2024-03-11T20:44:47 tree: Refactor text node updates
Nick Wellnhofer 4ccd3eb8 2024-03-11T19:43:56 tree: Refactor node insertion Also fixes a text coalescing bug.
Nick Wellnhofer 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.
Nick Wellnhofer e3342f73 2024-03-07T17:47:06 tree: Work on documentation
Nick Wellnhofer aef1ff43 2024-03-06T19:30:43 string: Fix xmlStrncatNew(NULL, "") This should return "" not NULL.
Nick Wellnhofer 9033a270 2024-03-05T16:45:44 malloc-fail: Stop using xmlSplitQName2 This function doesn't report malloc failures.
Nick Wellnhofer b38f8eae 2024-03-05T14:55:15 malloc-fail: Report in xmlAddAttributeDecl
Nick Wellnhofer 8677f547 2024-03-05T03:24:45 malloc-fail: Fix erroneous report in xmlNodeGetBaseSafe
Nick Wellnhofer 9b3750c6 2024-03-04T03:49:23 malloc-fail: Avoid use-after-free in xmlAddChild Returning NULL doesn't signal that the node was freed.
Nick Wellnhofer 702f2e46 2024-03-04T01:39:34 malloc-fail: Fix memory leak in xmlNewNodeEatName
Nick Wellnhofer 10c202f9 2024-03-04T01:31:12 malloc-fail: Check for NULL pointer in xmlSaveNotation*
Nick Wellnhofer 9c2d451c 2024-03-04T01:25:46 malloc-fail: Fix use-after-free in xmlBufBackToBuffer
Nick Wellnhofer edbf1eb6 2024-03-05T18:07:13 entities: Don't allow null name in xmlNewEntity
Nick Wellnhofer 50816b8d 2024-03-05T18:06:38 entities: Check for illegal entity types in xmlAddEntity
Nick Wellnhofer c1fe9e72 2024-03-06T15:21:49 io: Report more malloc failures when writing to output buffer
Nick Wellnhofer 10c4ed1f 2024-03-06T14:14:33 html: Fix quadratic behavior in htmlNodeDump Use an efficient buffer allocation scheme.
Nick Wellnhofer b1e75a91 2024-03-05T20:00:44 save: Report malloc failure in xmlAttrSerializeTxtContent
Nick Wellnhofer 3494aa4f 2024-03-04T01:39:00 save: Cast return code of xmlBufNodeDump Avoid implicit sign change.
Nick Wellnhofer 1d392fab 2024-03-05T18:06:02 save: Check for output buffer errors Report more error conditions.
Nick Wellnhofer d2f7ca53 2024-03-03T16:51:07 save: Add range check for level in xmlNodeDump
Nick Wellnhofer 3061b56a 2024-03-15T02:23:08 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.
Nick Wellnhofer af3d80b9 2024-03-14T20:49:39 valid: Check for elem->name in xmlIsID elem->name can be NULL is xmlNodeSetDoc failed.
Nick Wellnhofer 1233805d 2024-03-06T15:49:20 valid: Fix some return codes after errors
Nick Wellnhofer 04c691f7 2024-03-05T19:59:42 valid: Eliminate xmlCtxtGetDtdElementDesc Improves malloca failure reporting without parser context.
Nick Wellnhofer ab345338 2024-03-05T19:58:17 valid: Report malloc failure in legacy DTD serialization
Nick Wellnhofer 264b283c 2024-03-05T14:55:42 valid: Fix hash removal in xmlRemoveRef Don't create a NULL entry.
Nick Wellnhofer 802ad903 2024-03-05T14:54:16 valid: Don't report errors with null context
Nick Wellnhofer f797cdab 2024-03-02T18:59:16 valid: Remove id before updating attribute type
Nick Wellnhofer a3e11e3d 2024-03-01T15:55:35 valid: Fix id handling in xmlValidateDtd Free id table before and after validation.
Nick Wellnhofer c4e0db6a 2024-03-02T16:02:39 valid: Reset attribute in xmlFreeID
Nick Wellnhofer bbbd7f77 2024-03-01T14:27:08 valid: Rework checks in xmlValidateOneElement Don't check element for extra members and missing content. Consolidate checks for unexpected elements.
Nick Wellnhofer 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.
Nick Wellnhofer 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.
Nick Wellnhofer 291a9d0f 2024-03-08T18:45:24 valid: Set document on dummmy element declaration
Nick Wellnhofer b23175d1 2024-02-29T19:57:28 valid: Check element type in xmlIsID Also rearrange code for readability.
Nick Wellnhofer 0ddd63db 2024-02-29T16:40:26 valid: Change error code to XML_ERR_ARGUMENT
Nick Wellnhofer b043d959 2024-03-08T12:40:12 tree: Check return value of xmlNodeAddContent
Nick Wellnhofer 18ebdacf 2024-03-07T13:02:46 tree: Fix error return in xmlGetPropNodeValueInternal
Nick Wellnhofer e4e90961 2024-03-07T13:00:14 tree: Prefer xmlGetPropNodeInternal over xmlHasNsProp xmlHasNsProp can cause unreported malloc failures when looking up default attributes. Switch to xmlGetPropNodeInternal when moving attributes. We don't care about default attributes in this case.
Nick Wellnhofer 7d9ffd40 2024-03-06T19:44:00 tree: Report malloc failure in xmlAddNextSibling
Nick Wellnhofer bc7ab5a2 2024-03-02T18:59:51 tree: Rewrite xmlSetTreeDoc Report malloc failures. Fix when called directly on attribute node. Clear 'content' and 'last' and look up new entity for entity reference nodes.
Nick Wellnhofer 2ba690a7 2024-03-05T16:34:22 tree: Remove more unused node types
Nick Wellnhofer fc9a2ca0 2024-03-06T16:02:24 tree: Report more malloc failures