[xerces-c] 02/02: XERCESC-2214 - Wrong delete[] in MemBufInputSource dtor

[email protected]
Newsgroups gmane.text.xml.xerces-c.devel
Message-ID <[email protected]>
This is an automated email from the ASF dual-hosted git repository.

scantor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/xerces-c.git

commit 873fe028cfc3e7aa7ce07cdb7ec1d77b9b081472
Author: Scott Cantor <[email protected]>
AuthorDate: Wed Oct 5 16:40:38 2022 -0400

    XERCESC-2214 - Wrong delete[] in MemBufInputSource dtor
    
    https://issues.apache.org/jira/browse/XERCESC-2214
---
 src/xercesc/framework/MemBufInputSource.hpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/xercesc/framework/MemBufInputSource.hpp b/src/xercesc/framework/MemBufInputSource.hpp
index 677271b5c..b67cff8a5 100644
--- a/src/xercesc/framework/MemBufInputSource.hpp
+++ b/src/xercesc/framework/MemBufInputSource.hpp
@@ -48,9 +48,11 @@ class BinInputStream;
  *
  *  The passed buffer can be adopted or merely referenced. If it is adopted,
  *  then it must be dynamically allocated and will be destroyed when the
- *  input source is destroyed (no reference counting!.) If not adopted, the
- *  caller must insure that it remains valid until the input source object
- *  is destroyed.
+ *  input source is destroyed (no reference counting!.) Note that the
+ *  deallocation assumes that array deletion should be performed, so do
+ *  not pass a non-array-allocated buffer if asking for adoption.
+ *  If not adopted, the caller must insure that it remains valid until the
+ *  input source object is destroyed.
  *
  *  The other option indicates whether each stream created for this input
  *  source should get its own copy of the data, or whether it should just
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.