[jira] [Commented] (XERCESC-2220) Winsock Network Accessor does not support https URLs
[ https://issues.apache.org/jira/browse/XERCESC-2220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17433408#comment-17433408 ] Roger Leigh commented on XERCESC-2220: -- [~and...@avenza.com] The reason this hasn't been remedied is that no one has cared sufficiently about it to develop and submit a fix for it. If someone wishes to do so, I'll be more than happy to review and test it. As for how to satisfy {{find_package(curl)}}, you need to make sure the CURL installation is on your {{CMAKE_PREFIX_PATH}} so that it can be searched for and found successfully. One way to do this is to use _vcpkg _and its toolchain file, and all of the third-party dependencies can be trivially built and used. > Winsock Network Accessor does not support https URLs > > > Key: XERCESC-2220 > URL: https://issues.apache.org/jira/browse/XERCESC-2220 > Project: Xerces-C++ > Issue Type: Bug > Components: Utilities >Affects Versions: 3.2.3 > Environment: Windows 10 > MinGW 7.3.0 64-bit >Reporter: Florian Meinicke >Priority: Major > > According to [a > comment|https://issues.apache.org/jira/browse/XERCESC-2029?focusedCommentId=13982847&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13982847] > from > [Xerces-C++/XERCESC-2029|https://issues.apache.org/jira/browse/XERCESC-2029] > only the curl and winsock network accessors support https URLs. > While I got everything working on Linux using the curl accessor I cannot do > so on Windows. I'm still getting the "unsupported protocol in URL" error even > though I'm using the winsock accessor. > The problem appears to be that https has been deliberately disabled for the > winsock accessor: > Taken from {{src/xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.cpp}}: > {code:cpp} > BinInputStream* WinSockNetAccessor::makeNew(const XMLURL& urlSource, const > XMLNetHTTPInfo* httpInfo /*=0*/) > { > XMLURL::Protocols protocol = urlSource.getProtocol(); > switch(protocol) > { > case XMLURL::HTTP: > { > BinHTTPURLInputStream* retStrm = > new (urlSource.getMemoryManager()) > BinHTTPURLInputStream(urlSource, httpInfo); > return retStrm; > break; > } > // > // These are the only protocols we support now. So throw and > // unsupported protocol exception for the others. > // > default : > ThrowXMLwithMemMgr(MalformedURLException, > XMLExcepts::URL_UnsupportedProto, urlSource.getMemoryManager()); > break; > } > return 0; > } > {code} > My understanding is that the winsock accessor should support https URLs so > the question is why is https being disabled in {{WinSockNetAccessor}}? > -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[GitHub] [xerces-c] rleigh-codelibre commented on pull request #39: [XERCESC-2227] Memleak fixes in ContentSpecNode and ComplexTypeInfo classes
rleigh-codelibre commented on pull request #39: URL: https://github.com/apache/xerces-c/pull/39#issuecomment-950272435 @rouault Both now merged, thanks! -- 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] rleigh-codelibre merged pull request #40: [XERCESC-2228] DFAContentModel: fix memory leaks when OutOfMemoryException occurs
rleigh-codelibre merged pull request #40: URL: https://github.com/apache/xerces-c/pull/40 -- 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
[xerces-c] branch master updated: DFAContentModel: fix memory leaks when OutOfMemoryException occurs
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git The following commit(s) were added to refs/heads/master by this push: new a65990d DFAContentModel: fix memory leaks when OutOfMemoryException occurs new 6d5e52d Merge pull request #40 from rouault/fix_memleaks_DFAContentModel a65990d is described below commit a65990d79d3fc333d7481f010da4e165a88b6cb3 Author: Even Rouault AuthorDate: Thu Sep 23 16:50:38 2021 +0200 DFAContentModel: fix memory leaks when OutOfMemoryException occurs Fixes GDAL's https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39159 --- 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 6e4a393..4cfc85f 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 5030565..ddca8ec 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; + fMe
[GitHub] [xerces-c] rleigh-codelibre merged pull request #39: [XERCESC-2227] Memleak fixes in ContentSpecNode and ComplexTypeInfo classes
rleigh-codelibre merged pull request #39: URL: https://github.com/apache/xerces-c/pull/39 -- 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
[xerces-c] branch master updated (cec74e5 -> acd9752)
This is an automated email from the ASF dual-hosted git repository. rleigh pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/xerces-c.git. from cec74e5 Merge pull request #41 from rleigh-codelibre/XERCESC-2208_size_t_revert new 0dfd295 Fix potential memory leak in ContentSpecNode() constructor new 5e07b37 ComplexTypeInfo::makeContentModel(): fix memory leaks when a OutOfMemoryException occurs new d1f06f4 ComplexTypeInfo::convertContentSpecTree(): fix memory leaks when a OutOfMemoryException occurs new cc6dc0e ComplexTypeInfo::expandContentModel(): fix memory leaks when a OutOfMemoryException occurs new 884c163 ComplexTypeInfo::expandContentModel(): restore use of retNode as in original code (this is equivalent) new acd9752 Merge pull request #39 from rouault/memleak_fixes_ContentSpecNode_ComplexTypeInfo The 6455 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/schema/ComplexTypeInfo.cpp | 308 +- 3 files changed, 213 insertions(+), 138 deletions(-) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org