summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-10-30 12:21:20 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2022-10-30 14:12:55 +0100
commiteef0a7395cf623c9063a161e7107fa53b235ba98 (patch)
treecca149b0f16d4ae18cb9aca5a7e7ccc2e2d1e77c /include
parent7e078cc1fe122fcf994df8408999deaf470ba2af (diff)
downloadlibxml2-eef0a7395cf623c9063a161e7107fa53b235ba98.tar.gz
xinclude: Implement "streaming" mode
When using xmlreader, XPointer expressions in XIncludes simply cannot work. Expressions can reference nodes which weren't parsed yet or which were already deleted. After fixing nested XIncludes, we reference includes which were parsed previously. When streaming, these nodes could have been deleted, leading to use-after-free errors. Disallow XPointer expressions and truncate the include table in streaming mode.
Diffstat (limited to 'include')
-rw-r--r--include/private/xinclude.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/private/xinclude.h b/include/private/xinclude.h
new file mode 100644
index 00000000..ef9b0f02
--- /dev/null
+++ b/include/private/xinclude.h
@@ -0,0 +1,8 @@
+#ifndef XML_IO_H_PRIVATE__
+#define XML_IO_H_PRIVATE__
+
+#include <libxml/xinclude.h>
+
+int xmlXIncludeSetStreamingMode(xmlXIncludeCtxtPtr ctxt, int mode);
+
+#endif /* XML_IO_H_PRIVATE__ */