Re: Prepping a 3.2.4 release

2022-10-06 Thread Boris Kolpackov
Cantor, Scott  writes:

> Were it my decision, I would post a warning that the code is being
> sunsetted and anybody on it should be getting off it.

Getting off to what? Xerces-C++, with all its warts, is the only working,
open source XML Schema implementation for C/C++. And I know for a fact
that it is being used without much problems by quite a few people.

What I think would be reasonable to state is that the project, due to
limited resources, may not be able to promptly fix bugs and security
vulnerabilities.


> I definitely can't spend time there, so if you can, that's great.
> If not, it's best to wind down anything I can't support unless
> somebody else steps up to take it over.

I would be happy to CI a release candidate on our setup[1]. It covers
all the major platforms and compiler combinations (currently 60+ build
configurations). Just ping me with the branch/commit when it's ready.

[1] https://ci.cppget.org/?build-configs

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



Re: Prepping a 3.2.4 release

2022-10-06 Thread Cantor, Scott
>Getting off to what? Xerces-C++, with all its warts, is the only working,
>open source XML Schema implementation for C/C++. And I know for a fact
>that it is being used without much problems by quite a few people.

That's not relevant to the question. "There is nothing" is a real world answer, 
though I thought libxml2 had schema support also. I haven't checked it in a 
long time and it was moving that way even back when I picked Xerces.

People use EOL software all the time. People don't make rational decisions a 
lot of the time because they think the risk is outweighed by the cost, and that 
goes great until it doesn't.

>What I think would be reasonable to state is that the project, due to
>limited resources, may not be able to promptly fix bugs and security
>vulnerabilities.

That is disqualifying for production software. But let's just agree to 
disagree. You're not going to convince me and I'm not in the "convincing" 
business.

If the rest of the PMC agrees to post such a warning, then I will when I update 
the site for the release.

-- Scott




[jira] [Resolved] (XERCESC-2228) DFAContentModel: fix memory leaks when OutOfMemoryException occurs

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor resolved XERCESC-2228.
---
Fix Version/s: 4.0.0
   Resolution: Fixed

For now I'm reapplying this to the branch given the apparent misunderstanding I 
was operating under about Windows linkage. We'll revisit the patch if need be, 
which is not a big deal.

> DFAContentModel: fix memory leaks when OutOfMemoryException occurs
> --
>
> Key: XERCESC-2228
> URL: https://issues.apache.org/jira/browse/XERCESC-2228
> Project: Xerces-C++
>  Issue Type: Bug
>Affects Versions: 3.2.3
>Reporter: Even Rouault
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 4.0.0, 3.2.4
>
>
> Fixes GDAL's [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39159]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] 02/02: Merge pull request #28 from rouault/curl_memleak_fix

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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

commit e1665b4c4bd2f3e3ac637d36ac6515cf64c3bab2
Author: Roger Leigh 
AuthorDate: Tue Aug 24 06:23:42 2021 +0100

Merge pull request #28 from rouault/curl_memleak_fix

XERCESC-2218: CurlURLInputStream constructor: avoid memory leak
---
 .../util/NetAccessors/Curl/CurlURLInputStream.cpp  | 28 +-
 .../util/NetAccessors/Curl/CurlURLInputStream.hpp  |  2 ++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp 
b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp
index 5ed659389..2980dc211 100644
--- a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp
+++ b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp
@@ -160,7 +160,20 @@ CurlURLInputStream::CurlURLInputStream(const XMLURL& 
urlSource, const XMLNetHTTP
 while(fBufferHeadPtr == fBuffer)
 {
int runningHandles = 0;
-readMore(&runningHandles);
+try
+{
+readMore(&runningHandles);
+}
+catch(const MalformedURLException&)
+{
+cleanup();
+throw;
+}
+catch(const NetAccessorException&)
+{
+cleanup();
+throw;
+}
if(runningHandles == 0) break;
 }
 
@@ -174,18 +187,31 @@ CurlURLInputStream::CurlURLInputStream(const XMLURL& 
urlSource, const XMLNetHTTP
 
 CurlURLInputStream::~CurlURLInputStream()
 {
+cleanup();
+}
+
+
+void CurlURLInputStream::cleanup()
+{
+if (!fMulti )
+return;
+
 // Remove the easy handle from the multi stack
 curl_multi_remove_handle(fMulti, fEasy);
 
 // Cleanup the easy handle
 curl_easy_cleanup(fEasy);
+fEasy = NULL;
 
 // Cleanup the multi handle
 curl_multi_cleanup(fMulti);
+fMulti = NULL;
 
 if(fContentType) fMemoryManager->deallocate(fContentType);
+fContentType = NULL;
 
 if(fHeadersList) curl_slist_free_all(fHeadersList);
+fHeadersList = NULL;
 }
 
 
diff --git a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp 
b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp
index f75857b92..3900d4db5 100644
--- a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp
+++ b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp
@@ -61,6 +61,8 @@ private :
 CurlURLInputStream(const CurlURLInputStream&);
 CurlURLInputStream& operator=(const CurlURLInputStream&);
 
+void cleanup();
+
 static size_t staticWriteCallback(char *buffer,
   size_t size,
   size_t nitems,


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] 01/02: Merge pull request #40 from rouault/fix_memleaks_DFAContentModel

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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

commit 0b6165652fc7b8d93cb4af820de7c7f5a5998beb
Author: Roger Leigh 
AuthorDate: Sun Oct 24 08:01:46 2021 +0100

Merge pull request #40 from rouault/fix_memleaks_DFAContentModel

[XERCESC-2228] DFAContentModel: fix memory leaks when OutOfMemoryException 
occurs
---
 src/xercesc/validators/common/CMStateSet.hpp  |  11 +-
 src/xercesc/validators/common/DFAContentModel.cpp | 178 +-
 src/xercesc/validators/common/DFAContentModel.hpp |   1 +
 3 files changed, 147 insertions(+), 43 deletions(-)

diff --git a/src/xercesc/validators/common/CMStateSet.hpp 
b/src/xercesc/validators/common/CMStateSet.hpp
index 6bb275892..e018dc80a 100644
--- a/src/xercesc/validators/common/CMStateSet.hpp
+++ b/src/xercesc/validators/common/CMStateSet.hpp
@@ -32,6 +32,7 @@
 //
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -93,7 +94,15 @@ public :
 fDynamicBuffer->fArraySize = fBitCount / CMSTATE_BITFIELD_CHUNK;
 if (fBitCount % CMSTATE_BITFIELD_CHUNK)
 fDynamicBuffer->fArraySize++;
-fDynamicBuffer->fBitArray = (XMLInt32**) 
fDynamicBuffer->fMemoryManager->allocate(fDynamicBuffer->fArraySize*sizeof(XMLInt32*));
+try
+{
+fDynamicBuffer->fBitArray = (XMLInt32**) 
fDynamicBuffer->fMemoryManager->allocate(fDynamicBuffer->fArraySize*sizeof(XMLInt32*));
+}
+catch( const OutOfMemoryException& )
+{
+fDynamicBuffer->fMemoryManager->deallocate(fDynamicBuffer);
+throw;
+}
 for(XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; 
index++)
 fDynamicBuffer->fBitArray[index]=NULL;
 }
diff --git a/src/xercesc/validators/common/DFAContentModel.cpp 
b/src/xercesc/validators/common/DFAContentModel.cpp
index 2ae4b7d8e..56d77311d 100644
--- a/src/xercesc/validators/common/DFAContentModel.cpp
+++ b/src/xercesc/validators/common/DFAContentModel.cpp
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -87,7 +88,15 @@ DFAContentModel::DFAContentModel( const bool dtd
 , fMemoryManager(manager)
 {
 // And build the DFA data structures
-buildDFA(elemContentSpec);
+try
+{
+buildDFA(elemContentSpec);
+}
+catch( const OutOfMemoryException& )
+{
+cleanup();
+throw;
+}
 }
 
 DFAContentModel::DFAContentModel( const bool dtd
@@ -115,37 +124,83 @@ DFAContentModel::DFAContentModel( const bool 
dtd
 , fMemoryManager(manager)
 {
 // And build the DFA data structures
-buildDFA(elemContentSpec);
+try
+{
+buildDFA(elemContentSpec);
+}
+catch( const OutOfMemoryException& )
+{
+cleanup();
+throw;
+}
 }
 
 DFAContentModel::~DFAContentModel()
+{
+cleanup();
+}
+
+void DFAContentModel::cleanup()
 {
 //
 //  Clean up all the stuff that is not just temporary representation
 //  data that was cleaned up after building the DFA.
 //
-fMemoryManager->deallocate(fFinalStateFlags); //delete [] fFinalStateFlags;
+if( fFinalStateFlags )
+{
+fMemoryManager->deallocate(fFinalStateFlags); //delete [] 
fFinalStateFlags;
+fFinalStateFlags = NULL;
+}
 
 unsigned int index;
-for (index = 0; index < fTransTableSize; index++)
-fMemoryManager->deallocate(fTransTable[index]); //delete [] 
fTransTable[index];
-fMemoryManager->deallocate(fTransTable); //delete [] fTransTable;
+if( fTransTable )
+{
+for (index = 0; index < fTransTableSize; index++)
+fMemoryManager->deallocate(fTransTable[index]); //delete [] 
fTransTable[index];
+fMemoryManager->deallocate(fTransTable); //delete [] fTransTable;
+fTransTable = NULL;
+}
 
 if(fCountingStates)
 {
 for (unsigned int j = 0; j < fTransTableSize; ++j)
 delete fCountingStates[j];
 fMemoryManager->deallocate(fCountingStates);
+fCountingStates = NULL;
 }
 
-for (index = 0; index < fLeafCount; index++)
-delete fElemMap[index];
-fMemoryManager->deallocate(fElemMap); //delete [] fElemMap;
+if( fElemMap )
+{
+for (index = 0; index < fLeafCount; index++)
+delete fElemMap[index];
+fMemoryManager->deallocate(fElemMap); //delete [] fElemMap;
+fElemMap = NULL;
+}
 
 fMemoryManager->deallocate(fElemMapType); //delete [] fElemMapType;
+fElemMapType = NULL;
+
 fMemoryManager->deallocate(fLeafListType); //delete [] fLeafListType;
+fLeafListType = NULL;
 
 delete fLeafNameTypeVector;
+fLeafNameTypeVector = NULL;
+
+// Cleanup things that might now have been clean up by buildDFA()
+// if an 

[xerces-c] branch xerces-3.2 updated (b403617d2 -> e1665b4c4)

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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


from b403617d2 XERCESC-2214 - Wrong delete[] in MemBufInputSource dtor
 new 0b6165652 Merge pull request #40 from 
rouault/fix_memleaks_DFAContentModel
 new e1665b4c4 Merge pull request #28 from rouault/curl_memleak_fix

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../util/NetAccessors/Curl/CurlURLInputStream.cpp  |  28 +++-
 .../util/NetAccessors/Curl/CurlURLInputStream.hpp  |   2 +
 src/xercesc/validators/common/CMStateSet.hpp   |  11 +-
 src/xercesc/validators/common/DFAContentModel.cpp  | 178 -
 src/xercesc/validators/common/DFAContentModel.hpp  |   1 +
 5 files changed, 176 insertions(+), 44 deletions(-)


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Resolved] (XERCESC-2218) CurlURLInputStream constructor memory leak

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor resolved XERCESC-2218.
---
Resolution: Fixed

Reapplied to branch after ABI discussion pending confirmation on Windows.

> CurlURLInputStream constructor memory leak
> --
>
> Key: XERCESC-2218
> URL: https://issues.apache.org/jira/browse/XERCESC-2218
> Project: Xerces-C++
>  Issue Type: Bug
>Affects Versions: 3.2.3
>Reporter: Roger Leigh
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 4.0.0, 3.2.4
>
>
> CurlURLInputStream constructor calls the readMore() method, which can
> throw exceptions. In that situation, the destructor is not called, which
> results in resource/memory leaks. To fix that, catch the exceptions,
> manually do the cleanup and rethrow the exceptions.
> Found by ossfuzz (locally)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Resolved] (XERCESC-2227) Memleak fixes in ContentSpecNode and ComplexTypeInfo classes

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor resolved XERCESC-2227.
---
Resolution: Fixed

Applied to both branches.

> Memleak fixes in ContentSpecNode and ComplexTypeInfo classes
> 
>
> Key: XERCESC-2227
> URL: https://issues.apache.org/jira/browse/XERCESC-2227
> Project: Xerces-C++
>  Issue Type: Bug
>Affects Versions: 3.2.3
>Reporter: Even Rouault
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 4.0.0, 3.2.4
>
>
> when a OutOfMemory exception occurs.
> Spotted by [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39127] (on 
> GDAL)
> The commits are a bit in increasing order of triviality. The ownership rules 
> of ContentSpecNode first and second members, as used by ComplexTypeInfo, are 
> super complex. shared_ptr would be much welcome here! I can just tell that 
> valgrind on my test case reports no double-free nor memory leak after those 
> fixes



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[GitHub] [xerces-c] scantor commented on pull request #44: [XERCESC-2233] DFAContentModel::buildDFA(): fix memory leaks when OutOfMemoryException occurs

2022-10-06 Thread GitBox


scantor commented on PR #44:
URL: https://github.com/apache/xerces-c/pull/44#issuecomment-1269963838

   Given that this is just fixing a memory leak in a case where the process is 
going to die anyway, I'm inclined to leave it out of the branch and this patch 
release. That's not a good enough reason to make a non-trivial change to code I 
don't know at all. Can always revisit later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2233) DFAContentModel::buildDFA(): fix memory leaks when OutOfMemoryException occurs

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2233:
--
Fix Version/s: 4.0.0
   (was: 3.2.4)

> DFAContentModel::buildDFA(): fix memory leaks when OutOfMemoryException occurs
> --
>
> Key: XERCESC-2233
> URL: https://issues.apache.org/jira/browse/XERCESC-2233
> Project: Xerces-C++
>  Issue Type: Bug
>Affects Versions: 3.2.3
>Reporter: Even Rouault
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 4.0.0
>
>
> Fixes GDAL's [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41335]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2233) DFAContentModel::buildDFA(): fix memory leaks when OutOfMemoryException occurs

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2233:
--
Affects Version/s: 3.2.4

> DFAContentModel::buildDFA(): fix memory leaks when OutOfMemoryException occurs
> --
>
> Key: XERCESC-2233
> URL: https://issues.apache.org/jira/browse/XERCESC-2233
> Project: Xerces-C++
>  Issue Type: Bug
>Affects Versions: 3.2.3, 3.2.4
>Reporter: Even Rouault
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 4.0.0
>
>
> Fixes GDAL's [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41335]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Commented] (XERCESC-2233) DFAContentModel::buildDFA(): fix memory leaks when OutOfMemoryException occurs

2022-10-06 Thread Scott Cantor (Jira)


[ 
https://issues.apache.org/jira/browse/XERCESC-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17613496#comment-17613496
 ] 

Scott Cantor commented on XERCESC-2233:
---

This is a bit of bigger change to fix something that's really not much of a 
risk so skipping for the latest patch.

> DFAContentModel::buildDFA(): fix memory leaks when OutOfMemoryException occurs
> --
>
> Key: XERCESC-2233
> URL: https://issues.apache.org/jira/browse/XERCESC-2233
> Project: Xerces-C++
>  Issue Type: Bug
>Affects Versions: 3.2.3, 3.2.4
>Reporter: Even Rouault
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 4.0.0
>
>
> Fixes GDAL's [https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41335]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] branch xerces-3.2 updated (e1665b4c4 -> d80edf41b)

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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


from e1665b4c4 Merge pull request #28 from rouault/curl_memleak_fix
 new 4e713106e Merge pull request #39 from 
rouault/memleak_fixes_ContentSpecNode_ComplexTypeInfo
 new d80edf41b DFAContentModel::buildDFA(): correctly zero-initialize 
fFollowList

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/xercesc/validators/common/ContentSpecNode.cpp |  41 ++-
 src/xercesc/validators/common/ContentSpecNode.hpp |   2 +
 src/xercesc/validators/common/DFAContentModel.cpp |   2 +-
 src/xercesc/validators/schema/ComplexTypeInfo.cpp | 308 +-
 4 files changed, 214 insertions(+), 139 deletions(-)


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] 01/02: Merge pull request #39 from rouault/memleak_fixes_ContentSpecNode_ComplexTypeInfo

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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

commit 4e713106e3eb71c3b12b69d9d04d004c68c8447f
Author: Roger Leigh 
AuthorDate: Sun Oct 24 08:01:27 2021 +0100

Merge pull request #39 from 
rouault/memleak_fixes_ContentSpecNode_ComplexTypeInfo

[XERCESC-2227] Memleak fixes in ContentSpecNode and ComplexTypeInfo classes
---
 src/xercesc/validators/common/ContentSpecNode.cpp |  41 ++-
 src/xercesc/validators/common/ContentSpecNode.hpp |   2 +
 src/xercesc/validators/schema/ComplexTypeInfo.cpp | 308 +-
 3 files changed, 213 insertions(+), 138 deletions(-)

diff --git a/src/xercesc/validators/common/ContentSpecNode.cpp 
b/src/xercesc/validators/common/ContentSpecNode.cpp
index 7f2627bf8..0be134f8f 100644
--- a/src/xercesc/validators/common/ContentSpecNode.cpp
+++ b/src/xercesc/validators/common/ContentSpecNode.cpp
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 XERCES_CPP_NAMESPACE_BEGIN
@@ -52,31 +53,49 @@ ContentSpecNode::ContentSpecNode(const ContentSpecNode& 
toCopy) :
 , fMinOccurs(toCopy.fMinOccurs)
 , fMaxOccurs(toCopy.fMaxOccurs)
 {
-const QName* tempElement = toCopy.getElement();
-if (tempElement)
-fElement = new (fMemoryManager) QName(*tempElement);
+try
+{
+const QName* tempElement = toCopy.getElement();
+if (tempElement)
+fElement = new (fMemoryManager) QName(*tempElement);
 
-const ContentSpecNode *tmp = toCopy.getFirst();
-if (tmp)
-fFirst = new (fMemoryManager) ContentSpecNode(*tmp);
+const ContentSpecNode *tmp = toCopy.getFirst();
+if (tmp)
+fFirst = new (fMemoryManager) ContentSpecNode(*tmp);
+
+tmp = toCopy.getSecond();
+if (tmp)
+fSecond = new (fMemoryManager) ContentSpecNode(*tmp);
+}
+catch (const OutOfMemoryException&)
+{
+cleanup();
+
+throw;
+}
 
-tmp = toCopy.getSecond();
-if (tmp)
-fSecond = new (fMemoryManager) ContentSpecNode(*tmp);
 }
 
 ContentSpecNode::~ContentSpecNode()
+{
+cleanup();
+}
+
+void ContentSpecNode::cleanup()
 {
 // Delete our children, avoiding recursive cleanup
 if (fAdoptFirst && fFirst) {
-   deleteChildNode(fFirst);
+deleteChildNode(fFirst);
+fFirst = NULL;
 }
 
 if (fAdoptSecond && fSecond) {
-   deleteChildNode(fSecond);
+deleteChildNode(fSecond);
+fSecond = NULL;
 }
 
 delete fElement;
+fElement = NULL;
 }
 
 void ContentSpecNode::deleteChildNode(ContentSpecNode* node)
diff --git a/src/xercesc/validators/common/ContentSpecNode.hpp 
b/src/xercesc/validators/common/ContentSpecNode.hpp
index 24604c616..32f6264b9 100644
--- a/src/xercesc/validators/common/ContentSpecNode.hpp
+++ b/src/xercesc/validators/common/ContentSpecNode.hpp
@@ -150,6 +150,8 @@ private :
 // ---
 ContentSpecNode& operator=(const ContentSpecNode&);
 
+void cleanup();
+
// 
---
 // Helper functions
 // ---
diff --git a/src/xercesc/validators/schema/ComplexTypeInfo.cpp 
b/src/xercesc/validators/schema/ComplexTypeInfo.cpp
index 48f1860f4..7f650eb6f 100644
--- a/src/xercesc/validators/schema/ComplexTypeInfo.cpp
+++ b/src/xercesc/validators/schema/ComplexTypeInfo.cpp
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 XERCES_CPP_NAMESPACE_BEGIN
@@ -323,10 +324,19 @@ XMLContentModel* ComplexTypeInfo::makeContentModel(bool 
checkUPA)
 ContentSpecNode* aSpecNode = new (fMemoryManager) 
ContentSpecNode(*fContentSpec);
 
 if (checkUPA) {
-fContentSpecOrgURI = (unsigned int*) fMemoryManager->allocate
-(
-fContentSpecOrgURISize * sizeof(unsigned int)
-); //new unsigned int[fContentSpecOrgURISize];
+try
+{
+fContentSpecOrgURI = (unsigned int*) fMemoryManager->allocate
+(
+fContentSpecOrgURISize * sizeof(unsigned int)
+); //new unsigned int[fContentSpecOrgURISize];
+}
+catch (const OutOfMemoryException&)
+{
+delete aSpecNode;
+
+throw;
+}
 }
 
 aSpecNode = convertContentSpecTree(aSpecNode, checkUPA, 
useRepeatingLeafNodes(aSpecNode));
@@ -516,12 +526,31 @@ ComplexTypeInfo::convertContentSpecTree(ContentSpecNode* 
const curNode,
 ||   ((curType & 0x0f) == ContentSpecNode::Sequence))
 {
 ContentSpecNode* childNode = curNode->getFirst();
-ContentSpecNode* leftNode = convertContentSpecTree(childNode, 
checkUPA, bAllowCompactSyntax);
+ContentSpecNode* leftNode;
+try
+{
+left

[xerces-c] 02/02: DFAContentModel::buildDFA(): correctly zero-initialize fFollowList

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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

commit d80edf41bdcdf8a98c551b5ca5c3c4219b6b5873
Author: Even Rouault 
AuthorDate: Mon Dec 20 20:13:02 2021 +0100

DFAContentModel::buildDFA(): correctly zero-initialize fFollowList

Due to a copy&paste issue, the intended zero-initialization of
fFollowList wasn't done (copy&paste issue), and thus in case of
OutOfMemory exception when initializing the array, the memory freeing in
cleanup() could access uninitialized elements.

Follow-up of https://github.com/apache/xerces-c/pull/40 / 
a65990d79d3fc333d7481f010da4e165a88b6cb3

Fixes GDAL's https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42636
---
 src/xercesc/validators/common/DFAContentModel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xercesc/validators/common/DFAContentModel.cpp 
b/src/xercesc/validators/common/DFAContentModel.cpp
index 56d77311d..c14ae7b57 100644
--- a/src/xercesc/validators/common/DFAContentModel.cpp
+++ b/src/xercesc/validators/common/DFAContentModel.cpp
@@ -682,7 +682,7 @@ void DFAContentModel::buildDFA(ContentSpecNode* const 
curNode)
 (
 fLeafCount * sizeof(CMStateSet*)
 ); //new CMStateSet*[fLeafCount];
-memset(fLeafList, 0, fLeafCount*sizeof(CMStateSet*));
+memset(fFollowList, 0, fLeafCount*sizeof(CMStateSet*));
 for (index = 0; index < fLeafCount; index++)
 fFollowList[index] = new (fMemoryManager) CMStateSet(fLeafCount, 
fMemoryManager);
 


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Resolved] (XERCESC-2235) DFAContentModel::buildDFA(): correctly zero-initialize fFollowList

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor resolved XERCESC-2235.
---
Fix Version/s: 4.0.0
   Resolution: Fixed

Applied to both branches.

> DFAContentModel::buildDFA(): correctly zero-initialize fFollowList
> --
>
> Key: XERCESC-2235
> URL: https://issues.apache.org/jira/browse/XERCESC-2235
> Project: Xerces-C++
>  Issue Type: Bug
>Affects Versions: 3.2.3
>Reporter: Even Rouault
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 4.0.0, 3.2.4
>
>
> Due to a copy&paste issue, the intended zero-initialization of
> fFollowList wasn't done (copy&paste issue), and thus in case of
> OutOfMemory exception when initializing the array, the memory freeing in
> cleanup() could access uninitialized elements.
> Follow-up of https://github.com/apache/xerces-c/pull/40 / 
> a65990d79d3fc333d7481f010da4e165a88b6cb3
> Fixes GDAL's https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42636



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Closed] (XERCESC-2235) DFAContentModel::buildDFA(): correctly zero-initialize fFollowList

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor closed XERCESC-2235.
-

> DFAContentModel::buildDFA(): correctly zero-initialize fFollowList
> --
>
> Key: XERCESC-2235
> URL: https://issues.apache.org/jira/browse/XERCESC-2235
> Project: Xerces-C++
>  Issue Type: Bug
>Affects Versions: 3.2.3
>Reporter: Even Rouault
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 4.0.0, 3.2.4
>
>
> Due to a copy&paste issue, the intended zero-initialization of
> fFollowList wasn't done (copy&paste issue), and thus in case of
> OutOfMemory exception when initializing the array, the memory freeing in
> cleanup() could access uninitialized elements.
> Follow-up of https://github.com/apache/xerces-c/pull/40 / 
> a65990d79d3fc333d7481f010da4e165a88b6cb3
> Fixes GDAL's https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42636



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[GitHub] [xerces-c] scantor commented on pull request #51: [XERCESC-2241] Fix integer overflows in DFAContentModel class

2022-10-06 Thread GitBox


scantor commented on PR #51:
URL: https://github.com/apache/xerces-c/pull/51#issuecomment-1269982071

   @rleigh-codelibre  If you can apply this to master that will make it easier 
for me to cherry-pick back to the branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[GitHub] [xerces-c] scantor commented on pull request #51: [XERCESC-2241] Fix integer overflows in DFAContentModel class

2022-10-06 Thread GitBox


scantor commented on PR #51:
URL: https://github.com/apache/xerces-c/pull/51#issuecomment-1269983028

   (My only concern re: compatibility was the reference to size_it in the max 
function possibly causing compatibility issues, but I'll take the risk.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Commented] (XERCESC-2239) When XMLUni::fgDOMWRTSplitCdataSections is true (the default), invalid XML characters are allowed by DOMWriter

2022-10-06 Thread Scott Cantor (Jira)


[ 
https://issues.apache.org/jira/browse/XERCESC-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17613505#comment-17613505
 ] 

Scott Cantor commented on XERCESC-2239:
---

I suspect there's an intended distinction between "illegal" characters and 
"unrepresentable" ones. The feature apparently controls how unrepresentable 
characters are handled, and explicitly changes the behavior such that they're 
output numerically and don't cause an error.

I don't know the specs well enough to even consider making a change to this 
code, or even if a change is in fact the right thing to do. I'm pretty sure the 
current behavior is intentional.

> When XMLUni::fgDOMWRTSplitCdataSections is true (the default), invalid XML 
> characters are allowed by DOMWriter
> --
>
> Key: XERCESC-2239
> URL: https://issues.apache.org/jira/browse/XERCESC-2239
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: DOM
>Affects Versions: 3.2.0
> Environment: Operating System: All
> Platform: All
>Reporter: David Leffingwell
>Priority: Major
> Fix For: 3.2.4
>
>
> // Create a Document with a CDATA section that contains an invalid XML 
> character (e.g. 0x1b). 
> // This should fail when serializing the Document, but it does not when 
> XMLUni::fgDOMWRTSplitCdataSections is true.
> struct XercesDeleter
> {
> template
> void operator()(T* data) const
> {
> if (data) { data->release(); };
> }
> };
> typedef std::unique_ptr  
>  DOMWriterPtr;
> typedef std::unique_ptr 
> DOMDocumentPtr;
> XMLPlatformUtils::Initialize();
> DOMImplementation* impl = 
> DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("LS"));
>  // Create DOM with a CDATA section
> DOMDocumentPtr document(impl->createDocument());
> DOMElement* element = 
> document->createElementNS(XMLString::transcode("http://schemas.openxmlformats.org/wordprocessingml/2006/main";),
>  XMLString::transcode("w:t"));
> document->appendChild(element);
> DOMCDATASection* codesection = document->createCDATASection(XercesString("c = 
> '';")); // 0x1B is not a valid XML 1.0 character
> element->appendChild(codesection); 
> DOMWriterPtr writer(impl->createLSSerializer());
> writer->writeToString(document.get())



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2239) When XMLUni::fgDOMWRTSplitCdataSections is true (the default), invalid XML characters are allowed by DOMWriter

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2239:
--
Fix Version/s: (was: 3.2.4)

> When XMLUni::fgDOMWRTSplitCdataSections is true (the default), invalid XML 
> characters are allowed by DOMWriter
> --
>
> Key: XERCESC-2239
> URL: https://issues.apache.org/jira/browse/XERCESC-2239
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: DOM
>Affects Versions: 3.2.0
> Environment: Operating System: All
> Platform: All
>Reporter: David Leffingwell
>Priority: Major
>
> // Create a Document with a CDATA section that contains an invalid XML 
> character (e.g. 0x1b). 
> // This should fail when serializing the Document, but it does not when 
> XMLUni::fgDOMWRTSplitCdataSections is true.
> struct XercesDeleter
> {
> template
> void operator()(T* data) const
> {
> if (data) { data->release(); };
> }
> };
> typedef std::unique_ptr  
>  DOMWriterPtr;
> typedef std::unique_ptr 
> DOMDocumentPtr;
> XMLPlatformUtils::Initialize();
> DOMImplementation* impl = 
> DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("LS"));
>  // Create DOM with a CDATA section
> DOMDocumentPtr document(impl->createDocument());
> DOMElement* element = 
> document->createElementNS(XMLString::transcode("http://schemas.openxmlformats.org/wordprocessingml/2006/main";),
>  XMLString::transcode("w:t"));
> document->appendChild(element);
> DOMCDATASection* codesection = document->createCDATASection(XercesString("c = 
> '';")); // 0x1B is not a valid XML 1.0 character
> element->appendChild(codesection); 
> DOMWriterPtr writer(impl->createLSSerializer());
> writer->writeToString(document.get())



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2239) When XMLUni::fgDOMWRTSplitCdataSections is true (the default), invalid XML characters are allowed by DOMWriter

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2239:
--
Affects Version/s: 3.2.3
   3.2.2
   3.2.1
   3.2.4

> When XMLUni::fgDOMWRTSplitCdataSections is true (the default), invalid XML 
> characters are allowed by DOMWriter
> --
>
> Key: XERCESC-2239
> URL: https://issues.apache.org/jira/browse/XERCESC-2239
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: DOM
>Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4
> Environment: Operating System: All
> Platform: All
>Reporter: David Leffingwell
>Priority: Major
>
> // Create a Document with a CDATA section that contains an invalid XML 
> character (e.g. 0x1b). 
> // This should fail when serializing the Document, but it does not when 
> XMLUni::fgDOMWRTSplitCdataSections is true.
> struct XercesDeleter
> {
> template
> void operator()(T* data) const
> {
> if (data) { data->release(); };
> }
> };
> typedef std::unique_ptr  
>  DOMWriterPtr;
> typedef std::unique_ptr 
> DOMDocumentPtr;
> XMLPlatformUtils::Initialize();
> DOMImplementation* impl = 
> DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("LS"));
>  // Create DOM with a CDATA section
> DOMDocumentPtr document(impl->createDocument());
> DOMElement* element = 
> document->createElementNS(XMLString::transcode("http://schemas.openxmlformats.org/wordprocessingml/2006/main";),
>  XMLString::transcode("w:t"));
> document->appendChild(element);
> DOMCDATASection* codesection = document->createCDATASection(XercesString("c = 
> '';")); // 0x1B is not a valid XML 1.0 character
> element->appendChild(codesection); 
> DOMWriterPtr writer(impl->createLSSerializer());
> writer->writeToString(document.get())



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2195) Invalid attribute in .gitattributes file

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2195:
--
Fix Version/s: 3.2.4

> Invalid attribute in .gitattributes file
> 
>
> Key: XERCESC-2195
> URL: https://issues.apache.org/jira/browse/XERCESC-2195
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Miscellaneous
>Affects Versions: 3.2.3
>Reporter: Karen Arutyunov
>Priority: Minor
> Fix For: 3.2.4
>
>
> The attribute name 'eol' is misspelled in the .gitattributes file.
> The line
> *.bat text eof=crlf
> should be changed to
> *.bat text eol=crlf
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2196) cross-compiling issue

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2196:
--
Fix Version/s: 3.2.4

> cross-compiling issue
> -
>
> Key: XERCESC-2196
> URL: https://issues.apache.org/jira/browse/XERCESC-2196
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: ubuntu18.04,cross-compilation
>Reporter: ayoub serti
>Priority: Blocker
>  Labels: build, easyfix, github-import, pull-request-available, 
> ready-to-commit
> Fix For: 3.2.4
>
>
> When cross-compiling xerces on linux ubuntu, the configure script fails 
> because of a test program that try to run.
> The problem came from `configure.ac` where there is an AC_RUN_IFELSE without 
> action-if-cross-compiling action.
> the pull request fix this issue 
> [https://github.com/apache/xerces-c/pull/11|http://example.com/]
> No problem within CMake cross-compilation 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2196) cross-compiling issue

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2196:
--
Priority: Trivial  (was: Blocker)

> cross-compiling issue
> -
>
> Key: XERCESC-2196
> URL: https://issues.apache.org/jira/browse/XERCESC-2196
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: ubuntu18.04,cross-compilation
>Reporter: ayoub serti
>Priority: Trivial
>  Labels: build, easyfix, github-import, pull-request-available, 
> ready-to-commit
> Fix For: 3.2.4
>
>
> When cross-compiling xerces on linux ubuntu, the configure script fails 
> because of a test program that try to run.
> The problem came from `configure.ac` where there is an AC_RUN_IFELSE without 
> action-if-cross-compiling action.
> the pull request fix this issue 
> [https://github.com/apache/xerces-c/pull/11|http://example.com/]
> No problem within CMake cross-compilation 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Assigned] (XERCESC-2195) Invalid attribute in .gitattributes file

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor reassigned XERCESC-2195:
-

Assignee: Scott Cantor

> Invalid attribute in .gitattributes file
> 
>
> Key: XERCESC-2195
> URL: https://issues.apache.org/jira/browse/XERCESC-2195
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Miscellaneous
>Affects Versions: 3.2.3
>Reporter: Karen Arutyunov
>Assignee: Scott Cantor
>Priority: Minor
> Fix For: 3.2.4
>
>
> The attribute name 'eol' is misspelled in the .gitattributes file.
> The line
> *.bat text eof=crlf
> should be changed to
> *.bat text eol=crlf
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2197) Key Identity Constraint error reporting

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2197:
--
Fix Version/s: 3.2.4

> Key Identity Constraint error reporting
> ---
>
> Key: XERCESC-2197
> URL: https://issues.apache.org/jira/browse/XERCESC-2197
> Project: Xerces-C++
>  Issue Type: Improvement
>  Components: Validating Parser (XML Schema)
>Reporter: Stefan de Konink
>Priority: Major
> Fix For: 3.2.4
>
> Attachments: XERCESC-2197.patch
>
>
> The current Java version of Xerces has a significant better error reporting 
> on Identity Constraints, if compared with the C++ version. The primary issue 
> is that the the C++ version is only reporting the name of the element the key 
> identity constraint has been defined, the secondary issue is that the line 
> number reported is of the element closing the tag. A properly failing 
> document will therefore show oceans of duplicated lines in the output, while 
> in fact they are different elements tested, in different parts of the 
> document.
>  
> As example the following error is presented:
> Error at file /tmp/cxx.xml, line 5009571, char 24
>  Message: identity constraint key for element 'ServiceFrame' not found
> The expected error would be:
> Error at file /tmp/cxx.xml, line 1495133, char 51
> Key 'ToPointRef' with value 'CXX-ALL:RoutePoint:78210040' not found for 
> identity constraint of element 'ServiceFrame'.
>  
> Since the above is quite a difference I started to fiddle with GDB a bit:
>  
> {code:java}
> 302 {
> 303 FieldValueMap& valueMap = iter.nextElement();
> 304
> 305 if (!keyValueStore->contains(&valueMap) && fDoReportError) {
> 306
> 307 fScanner->getValidator()->emitError(XMLValid::IC_KeyNotFound,
> 308 fIdentityConstraint->getElementName());
> 309 }
> 310 }
> 311 }
> {code}
>  
>  
>  
> {code:java}
> p fIdentityConstraint.fIdentityConstraintName
> $34 = (XMLCh *) 0x590070 u"ToPointRef"
>  
> p fIdentityConstraint.fSelector.fXPath.fExpression
> $40 = (XMLCh *) 0x590390 u".//netex:ToPointRef"
>  
> p fIdentityConstraint.fFields.fElemList[0].fXPath.fExpression
> $32 = (XMLCh *) 0x590930 u"@ref"
>  
> p keyValueStore.fIdentityConstraint.fIdentityConstraintName
> $70 = (XMLCh *) 0x57cf10 u"ScheduledStopPointId"
>  
> p *valueMap.fValues.fElemList
> $41 = 0x8ce9d90 u"CXX-ALL:RoutePoint:78210040"
> p fIdentityConstraint->getElementName()
> $77 = (XMLCh *) 0x5902f0 u"ServiceFrame"
> {code}
>  
> So I would state that making this error on par with Java is quite trivial. 
> The only thing I did not find yet how to retrieve the line number for the 
> element that is currently being searched for. Would be nice to get a hand in 
> that direction for crafting a decent patch! 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2120) DOM Serialization does not correctly validate Surrogate Pairs

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2120:
--
Affects Version/s: 3.2.3
   3.2.2
   3.2.1
   3.2.4

> DOM Serialization does not correctly validate Surrogate Pairs
> -
>
> Key: XERCESC-2120
> URL: https://issues.apache.org/jira/browse/XERCESC-2120
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: DOM
>Affects Versions: 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4
>Reporter: Andrew Blackton
>Priority: Major
> Attachments: DOMCharacterValidationTest.cpp, DomStringValidation.patch
>
>
> When attempting to write an xml document containing valid UTF-16 surrogate 
> pairs an error occurs during validation. This causes the write to fail.
> It appears as though this issue was introduced with 
> https://issues.apache.org/jira/browse/XERCESC-1854 in the following commit 
> http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp?r1=768978&r2=1226891.
> I have supplied a reproducible and a potential patch. The string validator 
> should be responsible for determining if the codepoint is part of a surrogate 
> pair. However, I may also like to make the argument that this may not be the 
> right location to be doing the string validation. As it will leave the output 
> document in an inconsistent (half-written) state.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] branch xerces-3.2 updated: XERCESC-2195 - Invalid attribute in .gitattributes file

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/xerces-3.2 by this push:
 new e4d2a4c29 XERCESC-2195 - Invalid attribute in .gitattributes file
e4d2a4c29 is described below

commit e4d2a4c296b0f17c9d28a22f5f070c8a7b59325d
Author: Scott Cantor 
AuthorDate: Thu Oct 6 09:26:56 2022 -0400

XERCESC-2195 - Invalid attribute in .gitattributes file

https://issues.apache.org/jira/browse/XERCESC-2195
---
 .gitattributes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitattributes b/.gitattributes
index 9e0703d2a..610e91490 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2,7 +2,7 @@
 * text=auto
 
 # Text files with explicit CRLF line endings
-*.bat text eof=crlf
+*.bat text eol=crlf
 
 # Binary files
 *.gif binary


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2195) Invalid attribute in .gitattributes file

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2195:
--
Fix Version/s: 4.0.0

> Invalid attribute in .gitattributes file
> 
>
> Key: XERCESC-2195
> URL: https://issues.apache.org/jira/browse/XERCESC-2195
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Miscellaneous
>Affects Versions: 3.2.3
>Reporter: Karen Arutyunov
>Assignee: Scott Cantor
>Priority: Minor
> Fix For: 4.0.0, 3.2.4
>
>
> The attribute name 'eol' is misspelled in the .gitattributes file.
> The line
> *.bat text eof=crlf
> should be changed to
> *.bat text eol=crlf
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2196) cross-compiling issue

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2196:
--
Description: 
When cross-compiling xerces on linux ubuntu, the configure script fails because 
of a test program that try to run.

The problem came from `configure.ac` where there is an AC_RUN_IFELSE without 
action-if-cross-compiling action.

the pull request fix this issue [https://github.com/apache/xerces-c/pull/11]

No problem within CMake cross-compilation 

  was:
When cross-compiling xerces on linux ubuntu, the configure script fails because 
of a test program that try to run.

The problem came from `configure.ac` where there is an AC_RUN_IFELSE without 
action-if-cross-compiling action.

the pull request fix this issue 
[https://github.com/apache/xerces-c/pull/11|http://example.com/]

No problem within CMake cross-compilation 


> cross-compiling issue
> -
>
> Key: XERCESC-2196
> URL: https://issues.apache.org/jira/browse/XERCESC-2196
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: ubuntu18.04,cross-compilation
>Reporter: ayoub serti
>Priority: Trivial
>  Labels: build, easyfix, github-import, pull-request-available, 
> ready-to-commit
> Fix For: 3.2.4
>
>
> When cross-compiling xerces on linux ubuntu, the configure script fails 
> because of a test program that try to run.
> The problem came from `configure.ac` where there is an AC_RUN_IFELSE without 
> action-if-cross-compiling action.
> the pull request fix this issue [https://github.com/apache/xerces-c/pull/11]
> No problem within CMake cross-compilation 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] branch master updated (873fe028c -> 472f61290)

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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


from 873fe028c XERCESC-2214 - Wrong delete[] in MemBufInputSource dtor
 new 92019816a XERCESC-2195 - Invalid attribute in .gitattributes file
 new 472f61290 XERCESC-2196 - cross-compiling issue

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitattributes |  2 +-
 configure.ac   | 46 +-
 2 files changed, 46 insertions(+), 2 deletions(-)


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] branch xerces-3.2 updated: XERCESC-2196 - cross-compiling issue

2022-10-06 Thread scantor
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/xerces-3.2 by this push:
 new de63649c1 XERCESC-2196 - cross-compiling issue
de63649c1 is described below

commit de63649c1d36ff39386837bef6c0e8eb90655324
Author: Scott Cantor 
AuthorDate: Thu Oct 6 09:37:11 2022 -0400

XERCESC-2196 - cross-compiling issue

https://issues.apache.org/jira/browse/XERCESC-2196
---
 configure.ac | 46 +-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 6e1319d1a..d0b316bdf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,6 +247,28 @@ else
 [
   AC_MSG_RESULT([no])
   AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 if 
you have the `wcsrtombs' function.])
+],
+[
+  AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include 
+#include ]],
+[[
+mbstate_t st;
+memset(&st, 0, sizeof(st));
+char buffer[32];
+const wchar_t* src=L"help";
+wcsrtombs(buffer, &src, 32, &st);
+if(src==0)
+return 0;
+else
+return 1;]])],
+[
+  AC_MSG_RESULT([yes])
+  AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 
if you have the `wcsrtombs' function.])
+],
+[
+  AC_MSG_RESULT([no])
+  AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 
if you have the `wcsrtombs' function.])
+])
 ]
  )
 AC_MSG_CHECKING([for mbsrtowcs])
@@ -269,7 +291,29 @@ else
 [
   AC_MSG_RESULT([no])
   AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 if 
you have the `mbsrtowcs' function.])
-]
+],
+[
+AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include 

+#include ]],
+[[
+mbstate_t st;
+memset(&st, 0, sizeof(st));
+wchar_t buffer[32];
+const char* src="help";
+mbsrtowcs(buffer, &src, 32, &st);
+if(src==0)
+return 0;
+else
+return 1;]])],
+  [
+AC_MSG_RESULT([yes])
+AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [Define to 1 
if you have the `mbsrtowcs' function.])
+  ],
+  [
+AC_MSG_RESULT([no])
+AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 
if you have the `mbsrtowcs' function.])
+  ])
+] 
  )
 
 AC_MSG_CHECKING([if iconv uses const pointers])


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] 01/02: XERCESC-2195 - Invalid attribute in .gitattributes file

2022-10-06 Thread scantor
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 92019816ad8dd2470410e293b5f8eb9aff0b8ee9
Author: Scott Cantor 
AuthorDate: Thu Oct 6 09:26:56 2022 -0400

XERCESC-2195 - Invalid attribute in .gitattributes file

https://issues.apache.org/jira/browse/XERCESC-2195
---
 .gitattributes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitattributes b/.gitattributes
index 9e0703d2a..610e91490 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2,7 +2,7 @@
 * text=auto
 
 # Text files with explicit CRLF line endings
-*.bat text eof=crlf
+*.bat text eol=crlf
 
 # Binary files
 *.gif binary


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[xerces-c] 02/02: XERCESC-2196 - cross-compiling issue

2022-10-06 Thread scantor
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 472f612906ef860fab667af39fba51f01f2574db
Author: Scott Cantor 
AuthorDate: Thu Oct 6 09:37:11 2022 -0400

XERCESC-2196 - cross-compiling issue

https://issues.apache.org/jira/browse/XERCESC-2196
---
 configure.ac | 46 +-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 4e804aec9..2e920856f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -221,6 +221,28 @@ else
 [
   AC_MSG_RESULT([no])
   AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 if 
you have the `wcsrtombs' function.])
+],
+[
+  AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include 
+#include ]],
+[[
+mbstate_t st;
+memset(&st, 0, sizeof(st));
+char buffer[32];
+const wchar_t* src=L"help";
+wcsrtombs(buffer, &src, 32, &st);
+if(src==0)
+return 0;
+else
+return 1;]])],
+[
+  AC_MSG_RESULT([yes])
+  AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 
if you have the `wcsrtombs' function.])
+],
+[
+  AC_MSG_RESULT([no])
+  AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 
if you have the `wcsrtombs' function.])
+])
 ]
  )
 AC_MSG_CHECKING([for mbsrtowcs])
@@ -243,7 +265,29 @@ else
 [
   AC_MSG_RESULT([no])
   AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 if 
you have the `mbsrtowcs' function.])
-]
+],
+[
+AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include 

+#include ]],
+[[
+mbstate_t st;
+memset(&st, 0, sizeof(st));
+wchar_t buffer[32];
+const char* src="help";
+mbsrtowcs(buffer, &src, 32, &st);
+if(src==0)
+return 0;
+else
+return 1;]])],
+  [
+AC_MSG_RESULT([yes])
+AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [Define to 1 
if you have the `mbsrtowcs' function.])
+  ],
+  [
+AC_MSG_RESULT([no])
+AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 
if you have the `mbsrtowcs' function.])
+  ])
+] 
  )
 
 AC_MSG_CHECKING([if iconv uses const pointers])


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Closed] (XERCESC-2195) Invalid attribute in .gitattributes file

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor closed XERCESC-2195.
-

> Invalid attribute in .gitattributes file
> 
>
> Key: XERCESC-2195
> URL: https://issues.apache.org/jira/browse/XERCESC-2195
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Miscellaneous
>Affects Versions: 3.2.3
>Reporter: Karen Arutyunov
>Assignee: Scott Cantor
>Priority: Minor
> Fix For: 4.0.0, 3.2.4
>
>
> The attribute name 'eol' is misspelled in the .gitattributes file.
> The line
> *.bat text eof=crlf
> should be changed to
> *.bat text eol=crlf
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Closed] (XERCESC-2196) cross-compiling issue

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor closed XERCESC-2196.
-

> cross-compiling issue
> -
>
> Key: XERCESC-2196
> URL: https://issues.apache.org/jira/browse/XERCESC-2196
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: ubuntu18.04,cross-compilation
>Reporter: ayoub serti
>Assignee: Scott Cantor
>Priority: Trivial
>  Labels: build, easyfix, github-import, pull-request-available, 
> ready-to-commit
> Fix For: 4.0.0, 3.2.4
>
>
> When cross-compiling xerces on linux ubuntu, the configure script fails 
> because of a test program that try to run.
> The problem came from `configure.ac` where there is an AC_RUN_IFELSE without 
> action-if-cross-compiling action.
> the pull request fix this issue [https://github.com/apache/xerces-c/pull/11]
> No problem within CMake cross-compilation 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Resolved] (XERCESC-2196) cross-compiling issue

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor resolved XERCESC-2196.
---
Fix Version/s: 4.0.0
 Assignee: Scott Cantor
   Resolution: Fixed

Applied to both branches.

> cross-compiling issue
> -
>
> Key: XERCESC-2196
> URL: https://issues.apache.org/jira/browse/XERCESC-2196
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Build
>Affects Versions: 3.2.3
> Environment: ubuntu18.04,cross-compilation
>Reporter: ayoub serti
>Assignee: Scott Cantor
>Priority: Trivial
>  Labels: build, easyfix, github-import, pull-request-available, 
> ready-to-commit
> Fix For: 4.0.0, 3.2.4
>
>
> When cross-compiling xerces on linux ubuntu, the configure script fails 
> because of a test program that try to run.
> The problem came from `configure.ac` where there is an AC_RUN_IFELSE without 
> action-if-cross-compiling action.
> the pull request fix this issue [https://github.com/apache/xerces-c/pull/11]
> No problem within CMake cross-compilation 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Resolved] (XERCESC-2195) Invalid attribute in .gitattributes file

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor resolved XERCESC-2195.
---
Resolution: Fixed

Applied to both branches.

> Invalid attribute in .gitattributes file
> 
>
> Key: XERCESC-2195
> URL: https://issues.apache.org/jira/browse/XERCESC-2195
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: Miscellaneous
>Affects Versions: 3.2.3
>Reporter: Karen Arutyunov
>Assignee: Scott Cantor
>Priority: Minor
> Fix For: 4.0.0, 3.2.4
>
>
> The attribute name 'eol' is misspelled in the .gitattributes file.
> The line
> *.bat text eof=crlf
> should be changed to
> *.bat text eol=crlf
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2197) Key Identity Constraint error reporting

2022-10-06 Thread Scott Cantor (Jira)


 [ 
https://issues.apache.org/jira/browse/XERCESC-2197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-2197:
--
Fix Version/s: 4.0.0
   (was: 3.2.4)

> Key Identity Constraint error reporting
> ---
>
> Key: XERCESC-2197
> URL: https://issues.apache.org/jira/browse/XERCESC-2197
> Project: Xerces-C++
>  Issue Type: Improvement
>  Components: Validating Parser (XML Schema)
>Reporter: Stefan de Konink
>Priority: Major
> Fix For: 4.0.0
>
> Attachments: XERCESC-2197.patch
>
>
> The current Java version of Xerces has a significant better error reporting 
> on Identity Constraints, if compared with the C++ version. The primary issue 
> is that the the C++ version is only reporting the name of the element the key 
> identity constraint has been defined, the secondary issue is that the line 
> number reported is of the element closing the tag. A properly failing 
> document will therefore show oceans of duplicated lines in the output, while 
> in fact they are different elements tested, in different parts of the 
> document.
>  
> As example the following error is presented:
> Error at file /tmp/cxx.xml, line 5009571, char 24
>  Message: identity constraint key for element 'ServiceFrame' not found
> The expected error would be:
> Error at file /tmp/cxx.xml, line 1495133, char 51
> Key 'ToPointRef' with value 'CXX-ALL:RoutePoint:78210040' not found for 
> identity constraint of element 'ServiceFrame'.
>  
> Since the above is quite a difference I started to fiddle with GDB a bit:
>  
> {code:java}
> 302 {
> 303 FieldValueMap& valueMap = iter.nextElement();
> 304
> 305 if (!keyValueStore->contains(&valueMap) && fDoReportError) {
> 306
> 307 fScanner->getValidator()->emitError(XMLValid::IC_KeyNotFound,
> 308 fIdentityConstraint->getElementName());
> 309 }
> 310 }
> 311 }
> {code}
>  
>  
>  
> {code:java}
> p fIdentityConstraint.fIdentityConstraintName
> $34 = (XMLCh *) 0x590070 u"ToPointRef"
>  
> p fIdentityConstraint.fSelector.fXPath.fExpression
> $40 = (XMLCh *) 0x590390 u".//netex:ToPointRef"
>  
> p fIdentityConstraint.fFields.fElemList[0].fXPath.fExpression
> $32 = (XMLCh *) 0x590930 u"@ref"
>  
> p keyValueStore.fIdentityConstraint.fIdentityConstraintName
> $70 = (XMLCh *) 0x57cf10 u"ScheduledStopPointId"
>  
> p *valueMap.fValues.fElemList
> $41 = 0x8ce9d90 u"CXX-ALL:RoutePoint:78210040"
> p fIdentityConstraint->getElementName()
> $77 = (XMLCh *) 0x5902f0 u"ServiceFrame"
> {code}
>  
> So I would state that making this error on par with Java is quite trivial. 
> The only thing I did not find yet how to retrieve the line number for the 
> element that is currently being searched for. Would be nice to get a hand in 
> that direction for crafting a decent patch! 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Commented] (XERCESC-2197) Key Identity Constraint error reporting

2022-10-06 Thread Scott Cantor (Jira)


[ 
https://issues.apache.org/jira/browse/XERCESC-2197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17613543#comment-17613543
 ] 

Scott Cantor commented on XERCESC-2197:
---

This is an API change, so it not eligible for a patch. It can be applied to the 
master branch, but the chances of a release there are pretty low at this point.

> Key Identity Constraint error reporting
> ---
>
> Key: XERCESC-2197
> URL: https://issues.apache.org/jira/browse/XERCESC-2197
> Project: Xerces-C++
>  Issue Type: Improvement
>  Components: Validating Parser (XML Schema)
>Reporter: Stefan de Konink
>Priority: Major
> Fix For: 4.0.0
>
> Attachments: XERCESC-2197.patch
>
>
> The current Java version of Xerces has a significant better error reporting 
> on Identity Constraints, if compared with the C++ version. The primary issue 
> is that the the C++ version is only reporting the name of the element the key 
> identity constraint has been defined, the secondary issue is that the line 
> number reported is of the element closing the tag. A properly failing 
> document will therefore show oceans of duplicated lines in the output, while 
> in fact they are different elements tested, in different parts of the 
> document.
>  
> As example the following error is presented:
> Error at file /tmp/cxx.xml, line 5009571, char 24
>  Message: identity constraint key for element 'ServiceFrame' not found
> The expected error would be:
> Error at file /tmp/cxx.xml, line 1495133, char 51
> Key 'ToPointRef' with value 'CXX-ALL:RoutePoint:78210040' not found for 
> identity constraint of element 'ServiceFrame'.
>  
> Since the above is quite a difference I started to fiddle with GDB a bit:
>  
> {code:java}
> 302 {
> 303 FieldValueMap& valueMap = iter.nextElement();
> 304
> 305 if (!keyValueStore->contains(&valueMap) && fDoReportError) {
> 306
> 307 fScanner->getValidator()->emitError(XMLValid::IC_KeyNotFound,
> 308 fIdentityConstraint->getElementName());
> 309 }
> 310 }
> 311 }
> {code}
>  
>  
>  
> {code:java}
> p fIdentityConstraint.fIdentityConstraintName
> $34 = (XMLCh *) 0x590070 u"ToPointRef"
>  
> p fIdentityConstraint.fSelector.fXPath.fExpression
> $40 = (XMLCh *) 0x590390 u".//netex:ToPointRef"
>  
> p fIdentityConstraint.fFields.fElemList[0].fXPath.fExpression
> $32 = (XMLCh *) 0x590930 u"@ref"
>  
> p keyValueStore.fIdentityConstraint.fIdentityConstraintName
> $70 = (XMLCh *) 0x57cf10 u"ScheduledStopPointId"
>  
> p *valueMap.fValues.fElemList
> $41 = 0x8ce9d90 u"CXX-ALL:RoutePoint:78210040"
> p fIdentityConstraint->getElementName()
> $77 = (XMLCh *) 0x5902f0 u"ServiceFrame"
> {code}
>  
> So I would state that making this error on par with Java is quite trivial. 
> The only thing I did not find yet how to retrieve the line number for the 
> element that is currently being searched for. Would be nice to get a hand in 
> that direction for crafting a decent patch! 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



Re: Prepping a 3.2.4 release

2022-10-06 Thread Cantor, Scott
Where I'm at:

I've applied all the patches Roger applied to master back to the branch, 
including the few I had backed out due to an (apparent) mistake on my part 
about Windows linking, though I'm still verifying that. It's easy to work 
around anyway, so it's not a problem.

I reviewed other open tickets and closed a few. A few more are beyond my 
capabilities or risk tolerance, or are definite API changes.

What's left:
XERCESC-2241 - open PR guarding int overflow that I asked Roger to apply and 
I'll backport

XERCESC-2237 - I reproduced what seems to be a total failure of at least the 
curl and socket NetAccessors that seems kind of strange, I would think this 
would be a known issue if they're this broken but so far I can't make them 
work. Could be a parser setting I'm not familiar with. I plan to debug it a bit 
but don't expect to be able to fix it (I don't use that code).

Some time next week I expect I'll get a RC built and posted.

-- Scott