1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-20 03:52:25 +03:00

io: Fix memory lifetime issue with input buffers

xmlParserInputBufferCreateMem must make a copy of the buffer.

This fixes a regression from 2.11 which could cause reads from freed
memory depending on the use case.

Undeprecate xmlParserInputBufferCreateStatic which can avoid copying
the whole buffer.
This commit is contained in:
Nick Wellnhofer
2023-12-12 23:51:32 +01:00
parent 0e4a11bb30
commit c2bbeed1fd
5 changed files with 70 additions and 31 deletions

View File

@@ -216,7 +216,6 @@ XMLPUBFUN xmlParserInputBufferPtr
XMLPUBFUN xmlParserInputBufferPtr
xmlParserInputBufferCreateMem (const char *mem, int size,
xmlCharEncoding enc);
XML_DEPRECATED
XMLPUBFUN xmlParserInputBufferPtr
xmlParserInputBufferCreateStatic (const char *mem, int size,
xmlCharEncoding enc);