debian/0000775000000000000000000000000012257210002007157 5ustar debian/source/0000775000000000000000000000000011773452103010473 5ustar debian/source/format0000664000000000000000000000001411773445315011710 0ustar 3.0 (quilt) debian/copyright0000664000000000000000000000236511031525211011120 0ustar This package was debianized by Jay Berkenbilt . It was downloaded from http://xerces.apache.org/ Copyright (C) 1999-2007 The Apache Software Foundation Xerces-C++ is released under the terms of the Apache License, version 2.0, which can be found in /usr/share/common-licenses/Apache-2.0. The source distribution includes a "NOTICE" file as discussed in item 4(d) below. Here is the notice file text: ----------------------------------------------------------------------------- ========================================================================= == NOTICE file corresponding to section 4(d) of the Apache License, == == Version 2.0, in this case for the Apache Xerces distribution. == ========================================================================= This product includes software developed by The Apache Software Foundation (http://www.apache.org/). Portions of this software were originally based on the following: - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. ----------------------------------------------------------------------------- Additionally, portions of this distribution have the following copyrights: Copyright (C) 2006 Free Software Foundation, Inc. debian/changelog0000664000000000000000000000522712257210002011037 0ustar xerces-c2 (2.8.0+deb1-3build1) trusty; urgency=medium * No change rebuild against libicu52 -- Dimitri John Ledkov Fri, 27 Dec 2013 05:28:34 +0000 xerces-c2 (2.8.0+deb1-3) unstable; urgency=low * Package cleanup: update standards version, switch source format, hardening -- Jay Berkenbilt Fri, 29 Jun 2012 20:42:10 -0400 xerces-c2 (2.8.0+deb1-2) unstable; urgency=low * Apply patch to correct CVE-2009-1885: DoS attack from nested DTDs. (Closes: #541986) -- Jay Berkenbilt Mon, 24 Aug 2009 11:04:38 -0400 xerces-c2 (2.8.0+deb1-1) unstable; urgency=low * Repackage to eliminate tarball-in-orig.tar.gz packaging. This is the same version as 2.8.0. (Closes: #538572) * Updated standards to 3.8.3 (no changes required). -- Jay Berkenbilt Fri, 21 Aug 2009 18:28:01 -0400 xerces-c2 (2.8.0-4) unstable; urgency=low * Added '02-gnu.patch' and '12-gnu-reconf.patch' patches to add support for Hurd. Thanks Marc Dequènes (Duck) . (Closes: #530283) * Converted patches to use quilt * Created README.source * Updated standards version to 3.8.1 -- Jay Berkenbilt Thu, 11 Jun 2009 21:26:20 -0400 xerces-c2 (2.8.0-3) unstable; urgency=low * Change priority from extra to optional as priority optional packages depend on xerces-c2. -- Jay Berkenbilt Fri, 4 Jul 2008 12:52:37 -0400 xerces-c2 (2.8.0-2) unstable; urgency=low * Apply kbsd patches adjusted from xerces27. (Closes: #487653) * Replace Apache License with reference to file in common-licenses. -- Jay Berkenbilt Sat, 28 Jun 2008 17:17:44 -0400 xerces-c2 (2.8.0-1) unstable; urgency=low * Reorganize package in preparation for xerces 3.0.0: - source package: xerces28 -> xerces-c2 - binary package: libxerces28 -> libxerces-c28 - dev package: libxerces28-dev -> libxerces-c2-dev - doc package: libxerces28-doc -> libxerces-c2-doc -- Jay Berkenbilt Sat, 22 Mar 2008 14:53:43 -0400 xerces28 (2.8.0-2) unstable; urgency=low * Change build dependency to libicu-dev instead of libicu36-dev * Update standards version to 3.7.3 (no changes required) -- Jay Berkenbilt Mon, 10 Dec 2007 17:23:51 -0500 xerces28 (2.8.0-1) unstable; urgency=low * New upstream release -- Jay Berkenbilt Sat, 15 Sep 2007 21:57:13 -0400 xerces28 (2.8.0~rc1-1) experimental; urgency=low * Initial release. Note: doc-base refers to non-existent file here, but this should be fixed for the real release. -- Jay Berkenbilt Tue, 21 Aug 2007 15:45:40 -0400 debian/control0000664000000000000000000000371712257210002010572 0ustar Source: xerces-c2 Section: libs Priority: optional Build-Depends: cdbs (>= 0.4.106~), debhelper (>> 9), libicu-dev, cdbs, autotools-dev, hardening-wrapper Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Jay Berkenbilt Standards-Version: 3.9.3 Package: libxerces-c28 Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Replaces: libxerces28 Conflicts: libxerces28 (<= 2.8.0-2) Description: validating XML parser library for C++ Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating, and validating XML documents. Xerces-C++ is faithful to the XML 1.0 recommendation and associated standards (DOM 1.0, DOM 2.0, SAX 1.0, SAX 2.0, Namespaces, XML Schema Part 1 and Part 2). It also provides experimental implementations of XML 1.1 and DOM Level 3.0. The parser provides high performance, modularity, and scalability. Package: libxerces-c2-dev Section: libdevel Architecture: any Depends: ${misc:Depends}, libxerces-c28 (= ${binary:Version}), libc6-dev | libc-dev Conflicts: libxerces25-dev, libxerces26-dev, libxerces27-dev, libxerces28-dev (<= 2.8.0-2), libxerces-c3-dev Replaces: libxerces28-dev Suggests: libxerces-c2-doc Description: validating XML parser library for C++ (development files) Xerces-C++ is a validating XML parser written in a portable subset of C++. This package contains the development files for Xerces. It also contains various sample files. Package: libxerces-c2-doc Section: doc Depends: ${misc:Depends} Replaces: libxerces28-doc Conflicts: libxerces28-doc (<= 2.8.0-2) Architecture: all Suggests: libxerces-c2-dev Description: validating XML parser library for C++ (documentation) Xerces-C++ is a validating XML parser written in a portable subset of C++. This package contains the documentation files. debian/libxerces-c2-doc.doc-base0000664000000000000000000000072010771255433013622 0ustar Document: libxerces-c2-doc Title: Xerces-C++ Documentation v2.8.0 Author: The Apache Software Foundation Abstract: The Xerces C++ documentation includes general information, documentation of the Xerces API, FAQs, release information, sample code, and a lot of other useful information about the Xerces validating XML parser. Section: Programming Format: HTML Index: /usr/share/doc/libxerces-c2-doc/html/index.html Files: /usr/share/doc/libxerces-c2-doc/html/* debian/rules0000775000000000000000000000741411773452017010265 0ustar #!/usr/bin/make -f # Using dpkg-buildflags caused the package to fail to compile, and # this is an old package that's not worth much effort to fix. We'll # use hardening wrapper instead. export DEB_BUILD_HARDENING=1 # To distinguish variables that are truly local to this file (rather # than for use by cdbs), we adopt the convention of starting local # variables' names with l_. l_LIBMAJOR=28 l_PKGNAME=libxerces$(l_LIBMAJOR) l_LIBNAME1=libxerces-c l_SHORTSONAME1=$(l_LIBNAME1).so.$(l_LIBMAJOR) l_LONGSONAME1=$(l_SHORTSONAME1).0 l_LIBNAME2=libxerces-depdom l_SHORTSONAME2=$(l_LIBNAME2).so.$(l_LIBMAJOR) l_LONGSONAME2=$(l_SHORTSONAME2).0 l_PWD := $(shell pwd) l_INSTALL = $(l_PWD)/debian # Variables used by cdbs DEB_TAR_SRCDIR = xerces-c-src_2_8_0 DEB_INSTALL_DIRS_libxerces-c28 = /usr/lib DEB_INSTALL_DIRS_libxerces-c2-dev = /usr/include /usr/lib/$(l_PKGNAME) DEB_INSTALL_EXAMPLES_libxerces-c2-dev = samples/* DEB_INSTALL_DOCS_libxerces-c2-doc = \ doc/* DEB_INSTALL_DOCS_libxerces-c2-dev = \ credits.txt \ Readme.html DEB_COMPRESS_EXCLUDE = examples sample html # Exclude deprecrated dom library from shlib dependency calculation # since it depends upon the other library which may in turn result in # a circular dependency. It is harmless for this to be passed to all # dh_shlibdeps invocations for this package, so we won't worry about # the fact that cdbs (as of 0.4.25) doesn't give us any good way to do # this override on only one package. override DEB_DH_SHLIBDEPS_ARGS = -X libxerces-depdom.so # Include cdbs rules files. include /usr/share/cdbs/1/rules/debhelper.mk # Environment variables used by the build export USELIBWWW=0 export ICUROOT=/usr configure/libxerces-c28 configure/libxerces-c2-dev:: chmod a+x src/xercesc/runConfigure cd src/xercesc \ && XERCESCROOT=$(l_PWD) \ sh runConfigure -plinux -cgcc -xg++ -minmem -ticu \ -z -g \ -C --prefix=/usr \ -C --mandir=\$${prefix}/share/man \ -C --infodir=\$${prefix}/share/info build/libxerces-c28:: XERCESCROOT=$(l_PWD) \ $(MAKE) -C src/xercesc # The xerces install target installs development files as well as # shared libraries, and it doesn't necessarily install the right # shared library file names. Here we use make install to create the # development package, and we install the shared libraries for the # runtime packages manually. After running make install, remove all # installed shared library files, create a versionless dangling # symbolic link to the real shared library file that will be installed # in the runtime package, install config.status, which is needed to # build libxml-xerces-perl, and clean up some lintian warnings about # executable files (that aren't fixed by dh_fixperms). install/libxerces-c2-dev:: XERCESCROOT=$(l_PWD) \ $(MAKE) -C src/xercesc \ install PREFIX=$(l_INSTALL)/$(cdbs_curpkg)/usr \ prefix=$(l_INSTALL)/$(cdbs_curpkg)/usr cd $(l_INSTALL)/$(cdbs_curpkg)/usr/lib \ && rm -f $(l_LIBNAME1).so* \ && ln -sf $(l_SHORTSONAME1) $(l_LIBNAME1).so \ && rm -f $(l_LIBNAME2).so* \ && ln -sf $(l_SHORTSONAME2) $(l_LIBNAME2).so cp src/xercesc/config.status \ $(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_PKGNAME) find $(l_INSTALL)/$(cdbs_curpkg)/usr/include -type f -print | \ xargs chmod -x find $(DEB_INSTALL_EXAMPLES_libxerces-c2-dev) \ -type f \( -name '*.in' -o -name '*.cmd' \) -print | \ xargs chmod -x find $(DEB_INSTALL_EXAMPLES_libxerces-c2-dev) \ -name '*.cdbs-orig' -exec rm {} \; install/libxerces-c28:: cp lib/$(l_LIBNAME1).so \ $(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_LONGSONAME1) ln -sf $(l_LONGSONAME1) \ $(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_SHORTSONAME1) cp lib/$(l_LIBNAME2).so \ $(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_LONGSONAME2) ln -sf $(l_LONGSONAME2) \ $(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_SHORTSONAME2) debian/libxerces-c28.lintian-overrides0000664000000000000000000000010411745022176015122 0ustar libxerces-c28: package-name-doesnt-match-sonames libxerces-depdom28 debian/patches/0000775000000000000000000000000011773452103010622 5ustar debian/patches/CVE-2009-1885.patch0000664000000000000000000006434011244525652013265 0ustar Index: xerces-c2-2.8.0+deb1/src/xercesc/validators/DTD/DTDScanner.cpp =================================================================== --- xerces-c2-2.8.0+deb1.orig/src/xercesc/validators/DTD/DTDScanner.cpp 2007-08-28 14:43:25.000000000 -0400 +++ xerces-c2-2.8.0+deb1/src/xercesc/validators/DTD/DTDScanner.cpp 2009-08-24 11:03:02.940005745 -0400 @@ -27,7 +27,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -39,7 +41,6 @@ #include #include #include -#include XERCES_CPP_NAMESPACE_BEGIN @@ -1046,338 +1047,354 @@ // Check for a PE ref here, but don't require spaces checkForPERef(false, true); - // We have to check entity nesting here - unsigned int curReader; - + ValueStackOf* arrNestedDecl=NULL; // // We know that the caller just saw an opening parenthesis, so we need - // to parse until we hit the end of it, recursing for other nested - // parentheses we see. + // to parse until we hit the end of it; if we find several parenthesis, + // store them in an array to be processed later. // // We have to check for one up front, since it could be something like // (((a)*)) etc... // ContentSpecNode* curNode = 0; - if (fReaderMgr->skippedChar(chOpenParen)) + while(fReaderMgr->skippedChar(chOpenParen)) { - curReader = fReaderMgr->getCurrentReaderNum(); + // to check entity nesting + const unsigned int curReader = fReaderMgr->getCurrentReaderNum(); + if(arrNestedDecl==NULL) + arrNestedDecl=new (fMemoryManager) ValueStackOf(5, fMemoryManager); + arrNestedDecl->push(curReader); - // Lets call ourself and get back the resulting node - curNode = scanChildren(elemDecl, bufToUse); + // Check for a PE ref here, but don't require spaces + checkForPERef(false, true); + } - // If that failed, no need to go further, return failure - if (!curNode) - return 0; + // We must find a leaf node here, either standalone or nested in the parenthesis + if (!fReaderMgr->getName(bufToUse)) + { + fScanner->emitError(XMLErrs::ExpectedElementName); + return 0; + } - if (curReader != fReaderMgr->getCurrentReaderNum() && fScanner->getDoValidation()) - fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); + // + // Create a leaf node for it. If we can find the element id for + // this element, then use it. Else, we have to fault in an element + // decl, marked as created because of being in a content model. + // + XMLElementDecl* decl = fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bufToUse.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); + if (!decl) + { + decl = new (fGrammarPoolMemoryManager) DTDElementDecl + ( + bufToUse.getRawBuffer() + , fEmptyNamespaceId + , DTDElementDecl::Any + , fGrammarPoolMemoryManager + ); + decl->setCreateReason(XMLElementDecl::InContentModel); + decl->setExternalElemDeclaration(isReadingExternalEntity()); + fDTDGrammar->putElemDecl(decl); } - else + curNode = new (fGrammarPoolMemoryManager) ContentSpecNode + ( + decl->getElementName() + , fGrammarPoolMemoryManager + ); + + // Check for a PE ref here, but don't require spaces + const bool gotSpaces = checkForPERef(false, true); + + // Check for a repetition character after the leaf + XMLCh repCh = fReaderMgr->peekNextChar(); + ContentSpecNode* tmpNode = makeRepNode(repCh, curNode, fGrammarPoolMemoryManager); + if (tmpNode != curNode) { - // Not a nested paren, so it must be a leaf node - if (!fReaderMgr->getName(bufToUse)) + if (gotSpaces) { - fScanner->emitError(XMLErrs::ExpectedElementName); - return 0; + if (fScanner->emitErrorWillThrowException(XMLErrs::UnexpectedWhitespace)) + { + delete tmpNode; + } + fScanner->emitError(XMLErrs::UnexpectedWhitespace); } + fReaderMgr->getNextChar(); + curNode = tmpNode; + } + while(arrNestedDecl==NULL || !arrNestedDecl->empty()) + { + // Check for a PE ref here, but don't require spaces + checkForPERef(false, true); + // - // Create a leaf node for it. If we can find the element id for - // this element, then use it. Else, we have to fault in an element - // decl, marked as created because of being in a content model. + // Ok, the next character tells us what kind of content this particular + // model this particular parentesized section is. Its either a choice if + // we see ',', a sequence if we see '|', or a single leaf node if we see + // a closing paren. + // + const XMLCh opCh = fReaderMgr->peekNextChar(); + + if ((opCh != chComma) + && (opCh != chPipe) + && (opCh != chCloseParen)) + { + // Not a legal char, so delete our node and return failure + delete curNode; + fScanner->emitError(XMLErrs::ExpectedSeqChoiceLeaf); + return 0; + } + // - XMLElementDecl* decl = fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bufToUse.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); - if (!decl) + // Create the head node of the correct type. We need this to remember + // the top of the local tree. If it was a single subexpr, then just + // set the head node to the current node. For the others, we'll build + // the tree off the second child as we move across. + // + ContentSpecNode* headNode = 0; + ContentSpecNode::NodeTypes curType = ContentSpecNode::UnknownType; + if (opCh == chComma) { - decl = new (fGrammarPoolMemoryManager) DTDElementDecl + curType = ContentSpecNode::Sequence; + headNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( - bufToUse.getRawBuffer() - , fEmptyNamespaceId - , DTDElementDecl::Any + curType + , curNode + , 0 + , true + , true , fGrammarPoolMemoryManager ); - decl->setCreateReason(XMLElementDecl::InContentModel); - decl->setExternalElemDeclaration(isReadingExternalEntity()); - fDTDGrammar->putElemDecl(decl); + curNode = headNode; } - curNode = new (fGrammarPoolMemoryManager) ContentSpecNode - ( - decl->getElementName() - , fGrammarPoolMemoryManager - ); - - // Check for a PE ref here, but don't require spaces - const bool gotSpaces = checkForPERef(false, true); - - // Check for a repetition character after the leaf - const XMLCh repCh = fReaderMgr->peekNextChar(); - ContentSpecNode* tmpNode = makeRepNode(repCh, curNode, fGrammarPoolMemoryManager); - if (tmpNode != curNode) + else if (opCh == chPipe) { - if (gotSpaces) - { - if (fScanner->emitErrorWillThrowException(XMLErrs::UnexpectedWhitespace)) - { - delete tmpNode; - } - fScanner->emitError(XMLErrs::UnexpectedWhitespace); - } + curType = ContentSpecNode::Choice; + headNode = new (fGrammarPoolMemoryManager) ContentSpecNode + ( + curType + , curNode + , 0 + , true + , true + , fGrammarPoolMemoryManager + ); + curNode = headNode; + } + else + { + headNode = curNode; fReaderMgr->getNextChar(); - curNode = tmpNode; } - } - - // Check for a PE ref here, but don't require spaces - checkForPERef(false, true); - // - // Ok, the next character tells us what kind of content this particular - // model this particular parentesized section is. Its either a choice if - // we see ',', a sequence if we see '|', or a single leaf node if we see - // a closing paren. - // - const XMLCh opCh = fReaderMgr->peekNextChar(); - - if ((opCh != chComma) - && (opCh != chPipe) - && (opCh != chCloseParen)) - { - // Not a legal char, so delete our node and return failure - delete curNode; - fScanner->emitError(XMLErrs::ExpectedSeqChoiceLeaf); - return 0; - } - - // - // Create the head node of the correct type. We need this to remember - // the top of the local tree. If it was a single subexpr, then just - // set the head node to the current node. For the others, we'll build - // the tree off the second child as we move across. - // - ContentSpecNode* headNode = 0; - ContentSpecNode::NodeTypes curType = ContentSpecNode::UnknownType; - if (opCh == chComma) - { - curType = ContentSpecNode::Sequence; - headNode = new (fGrammarPoolMemoryManager) ContentSpecNode - ( - curType - , curNode - , 0 - , true - , true - , fGrammarPoolMemoryManager - ); - curNode = headNode; - } - else if (opCh == chPipe) - { - curType = ContentSpecNode::Choice; - headNode = new (fGrammarPoolMemoryManager) ContentSpecNode - ( - curType - , curNode - , 0 - , true - , true - , fGrammarPoolMemoryManager - ); - curNode = headNode; - } - else - { - headNode = curNode; - fReaderMgr->getNextChar(); - } - - // - // If it was a sequence or choice, we just loop until we get to the - // end of our section, adding each new leaf or sub expression to the - // right child of the current node, and making that new node the current - // node. - // - if ((opCh == chComma) || (opCh == chPipe)) - { - ContentSpecNode* lastNode = 0; - while (true) + // + // If it was a sequence or choice, we just loop until we get to the + // end of our section, adding each new leaf or sub expression to the + // right child of the current node, and making that new node the current + // node. + // + if ((opCh == chComma) || (opCh == chPipe)) { - // - // The next thing must either be another | or , character followed - // by another leaf or subexpression, or a closing parenthesis, or a - // PE ref. - // - if (fReaderMgr->lookingAtChar(chPercent)) - { - checkForPERef(false, true); - } - else if (fReaderMgr->skippedSpace()) - { - // Just skip whitespace - fReaderMgr->skipPastSpaces(); - } - else if (fReaderMgr->skippedChar(chCloseParen)) + ContentSpecNode* lastNode = 0; + while (true) { // - // We've hit the end of this section, so break out. But, we - // need to see if we left a partial sequence of choice node - // without a second node. If so, we have to undo that and - // put its left child into the right node of the previous - // node. + // The next thing must either be another | or , character followed + // by another leaf or subexpression, or a closing parenthesis, or a + // PE ref. // - if ((curNode->getType() == ContentSpecNode::Choice) - || (curNode->getType() == ContentSpecNode::Sequence)) + if (fReaderMgr->lookingAtChar(chPercent)) + { + checkForPERef(false, true); + } + else if (fReaderMgr->skippedSpace()) { - if (!curNode->getSecond()) + // Just skip whitespace + fReaderMgr->skipPastSpaces(); + } + else if (fReaderMgr->skippedChar(chCloseParen)) + { + // + // We've hit the end of this section, so break out. But, we + // need to see if we left a partial sequence of choice node + // without a second node. If so, we have to undo that and + // put its left child into the right node of the previous + // node. + // + if ((curNode->getType() == ContentSpecNode::Choice) + || (curNode->getType() == ContentSpecNode::Sequence)) { - ContentSpecNode* saveFirst = curNode->orphanFirst(); - lastNode->setSecond(saveFirst); - curNode = lastNode; + if (!curNode->getSecond()) + { + ContentSpecNode* saveFirst = curNode->orphanFirst(); + lastNode->setSecond(saveFirst); + curNode = lastNode; + } } + break; } - break; - } - else if (fReaderMgr->skippedChar(opCh)) - { - // Check for a PE ref here, but don't require spaces - checkForPERef(false, true); - - if (fReaderMgr->skippedChar(chOpenParen)) + else if (fReaderMgr->skippedChar(opCh)) { - curReader = fReaderMgr->getCurrentReaderNum(); + // Check for a PE ref here, but don't require spaces + checkForPERef(false, true); - // Recurse to handle this new guy - ContentSpecNode* subNode; - try { - subNode = scanChildren(elemDecl, bufToUse); - } - catch (const XMLErrs::Codes) + if (fReaderMgr->skippedChar(chOpenParen)) { - delete headNode; - throw; - } + const unsigned int curReader = fReaderMgr->getCurrentReaderNum(); - // If it failed, we are done, clean up here and return failure - if (!subNode) - { - delete headNode; - return 0; + // Recurse to handle this new guy + ContentSpecNode* subNode; + try { + subNode = scanChildren(elemDecl, bufToUse); + } + catch (const XMLErrs::Codes) + { + delete headNode; + throw; + } + + // If it failed, we are done, clean up here and return failure + if (!subNode) + { + delete headNode; + return 0; + } + + if (curReader != fReaderMgr->getCurrentReaderNum() && fScanner->getDoValidation()) + fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); + + // Else patch it in and make it the new current + ContentSpecNode* newCur = new (fGrammarPoolMemoryManager) ContentSpecNode + ( + curType + , subNode + , 0 + , true + , true + , fGrammarPoolMemoryManager + ); + curNode->setSecond(newCur); + lastNode = curNode; + curNode = newCur; } + else + { + // + // Got to be a leaf node, so get a name. If we cannot get + // one, then clean up and get outa here. + // + if (!fReaderMgr->getName(bufToUse)) + { + delete headNode; + fScanner->emitError(XMLErrs::ExpectedElementName); + return 0; + } + + // + // Create a leaf node for it. If we can find the element + // id for this element, then use it. Else, we have to + // fault in an element decl, marked as created because + // of being in a content model. + // + XMLElementDecl* decl = fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bufToUse.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); + if (!decl) + { + decl = new (fGrammarPoolMemoryManager) DTDElementDecl + ( + bufToUse.getRawBuffer() + , fEmptyNamespaceId + , DTDElementDecl::Any + , fGrammarPoolMemoryManager + ); + decl->setCreateReason(XMLElementDecl::InContentModel); + decl->setExternalElemDeclaration(isReadingExternalEntity()); + fDTDGrammar->putElemDecl(decl); + } - if (curReader != fReaderMgr->getCurrentReaderNum() && fScanner->getDoValidation()) - fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); + ContentSpecNode* tmpLeaf = new (fGrammarPoolMemoryManager) ContentSpecNode + ( + decl->getElementName() + , fGrammarPoolMemoryManager + ); - // Else patch it in and make it the new current - ContentSpecNode* newCur = new (fGrammarPoolMemoryManager) ContentSpecNode - ( - curType - , subNode - , 0 - , true - , true - , fGrammarPoolMemoryManager - ); - curNode->setSecond(newCur); - lastNode = curNode; - curNode = newCur; + // Check for a repetition character after the leaf + const XMLCh repCh = fReaderMgr->peekNextChar(); + ContentSpecNode* tmpLeaf2 = makeRepNode(repCh, tmpLeaf, fGrammarPoolMemoryManager); + if (tmpLeaf != tmpLeaf2) + fReaderMgr->getNextChar(); + + // + // Create a new sequence or choice node, with the leaf + // (or rep surrounding it) we just got as its first node. + // Make the new node the second node of the current node, + // and then make it the current node. + // + ContentSpecNode* newCur = new (fGrammarPoolMemoryManager) ContentSpecNode + ( + curType + , tmpLeaf2 + , 0 + , true + , true + , fGrammarPoolMemoryManager + ); + curNode->setSecond(newCur); + lastNode = curNode; + curNode = newCur; + } } else { - // - // Got to be a leaf node, so get a name. If we cannot get - // one, then clean up and get outa here. - // - if (!fReaderMgr->getName(bufToUse)) + // Cannot be valid + delete headNode; // emitError may do a throw so need to clean-up first + if (opCh == chComma) { - delete headNode; - fScanner->emitError(XMLErrs::ExpectedElementName); - return 0; + fScanner->emitError(XMLErrs::ExpectedChoiceOrCloseParen); } - - // - // Create a leaf node for it. If we can find the element - // id for this element, then use it. Else, we have to - // fault in an element decl, marked as created because - // of being in a content model. - // - XMLElementDecl* decl = fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bufToUse.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); - if (!decl) + else { - decl = new (fGrammarPoolMemoryManager) DTDElementDecl + fScanner->emitError ( - bufToUse.getRawBuffer() - , fEmptyNamespaceId - , DTDElementDecl::Any - , fGrammarPoolMemoryManager + XMLErrs::ExpectedSeqOrCloseParen + , elemDecl.getFullName() ); - decl->setCreateReason(XMLElementDecl::InContentModel); - decl->setExternalElemDeclaration(isReadingExternalEntity()); - fDTDGrammar->putElemDecl(decl); - } + } + return 0; + } + } + } - ContentSpecNode* tmpLeaf = new (fGrammarPoolMemoryManager) ContentSpecNode - ( - decl->getElementName() - , fGrammarPoolMemoryManager - ); + // + // We saw the terminating parenthesis so lets check for any repetition + // character, and create a node for that, making the head node the child + // of it. + // + const XMLCh repCh = fReaderMgr->peekNextChar(); + curNode = makeRepNode(repCh, headNode, fGrammarPoolMemoryManager); + if (curNode != headNode) + fReaderMgr->getNextChar(); + + // prepare for recursion + if(arrNestedDecl==NULL) + break; + else + { + // If that failed, no need to go further, return failure + if (!curNode) + return 0; - // Check for a repetition character after the leaf - const XMLCh repCh = fReaderMgr->peekNextChar(); - ContentSpecNode* tmpLeaf2 = makeRepNode(repCh, tmpLeaf, fGrammarPoolMemoryManager); - if (tmpLeaf != tmpLeaf2) - fReaderMgr->getNextChar(); + const unsigned int curReader = arrNestedDecl->pop(); + if (curReader != fReaderMgr->getCurrentReaderNum() && fScanner->getValidationScheme() == XMLScanner::Val_Always) + fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); - // - // Create a new sequence or choice node, with the leaf - // (or rep surrounding it) we just got as its first node. - // Make the new node the second node of the current node, - // and then make it the current node. - // - ContentSpecNode* newCur = new (fGrammarPoolMemoryManager) ContentSpecNode - ( - curType - , tmpLeaf2 - , 0 - , true - , true - , fGrammarPoolMemoryManager - ); - curNode->setSecond(newCur); - lastNode = curNode; - curNode = newCur; - } - } - else + if(arrNestedDecl->empty()) { - // Cannot be valid - delete headNode; // emitError may do a throw so need to clean-up first - if (opCh == chComma) - { - fScanner->emitError(XMLErrs::ExpectedChoiceOrCloseParen); - } - else - { - fScanner->emitError - ( - XMLErrs::ExpectedSeqOrCloseParen - , elemDecl.getFullName() - ); - } - return 0; + delete arrNestedDecl; + arrNestedDecl=NULL; } } } - // - // We saw the terminating parenthesis so lets check for any repetition - // character, and create a node for that, making the head node the child - // of it. - // - XMLCh repCh = fReaderMgr->peekNextChar(); - ContentSpecNode* retNode = makeRepNode(repCh, headNode, fGrammarPoolMemoryManager); - if (retNode != headNode) - fReaderMgr->getNextChar(); - - return retNode; + return curNode; } debian/patches/kfreebsd.patch0000664000000000000000000000572711243616760013446 0ustar Index: xerces-c-src_2_8_0/samples/configure.in =================================================================== --- xerces-c-src_2_8_0.orig/samples/configure.in 2009-06-11 21:05:11.449609745 -0400 +++ xerces-c-src_2_8_0/samples/configure.in 2009-06-11 21:05:11.541609859 -0400 @@ -38,6 +38,7 @@ *-*-sysv5uw7*) platform=UNIXWARE ;; *-*-beos*) platform=BEOS ;; *-*-linux*) platform=LINUX ;; + *-*-k*bsd*) platform=LINUX ;; *-*-nto*) platform=QNX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; Index: xerces-c-src_2_8_0/src/xercesc/configure.in =================================================================== --- xerces-c-src_2_8_0.orig/src/xercesc/configure.in 2009-06-11 21:05:11.457609718 -0400 +++ xerces-c-src_2_8_0/src/xercesc/configure.in 2009-06-11 21:05:11.549609401 -0400 @@ -35,6 +35,7 @@ *-*-beos*) platform=BEOS ;; *-*-nto*) platform=QNX ;; *-*-linux*) platform=LINUX ;; + *-*-k*bsd*) platform=LINUX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; *-*-irix*) platform=IRIX ;; Index: xerces-c-src_2_8_0/src/xercesc/util/AutoSense.hpp =================================================================== --- xerces-c-src_2_8_0.orig/src/xercesc/util/AutoSense.hpp 2009-06-11 21:05:11.461609840 -0400 +++ xerces-c-src_2_8_0/src/xercesc/util/AutoSense.hpp 2009-06-11 21:05:11.549609401 -0400 @@ -59,6 +59,9 @@ #if defined(__s390__) #define XML_LINUX_390 #endif +#elif defined(__GLIBC__) + #define XML_LINUX + #define XML_UNIX #elif defined(__FreeBSD__) #define XML_FREEBSD #define XML_UNIX Index: xerces-c-src_2_8_0/src/xercesc/util/Platforms/Linux/LinuxPlatformUtils.cpp =================================================================== --- xerces-c-src_2_8_0.orig/src/xercesc/util/Platforms/Linux/LinuxPlatformUtils.cpp 2009-06-11 21:05:11.473609958 -0400 +++ xerces-c-src_2_8_0/src/xercesc/util/Platforms/Linux/LinuxPlatformUtils.cpp 2009-06-11 21:05:11.549609401 -0400 @@ -37,7 +37,7 @@ #include #include #include -#include //for PATH_MAX +#include // for PATH_MAX #include #include #include Index: xerces-c-src_2_8_0/tests/configure.in =================================================================== --- xerces-c-src_2_8_0.orig/tests/configure.in 2009-06-11 21:05:11.485609640 -0400 +++ xerces-c-src_2_8_0/tests/configure.in 2009-06-11 21:05:11.549609401 -0400 @@ -38,6 +38,7 @@ *-*-sysv5uw7*) platform=UNIXWARE ;; *-*-beos*) platform=BEOS ;; *-*-linux*) platform=LINUX ;; + *-*-k*bsd*) platform=LINUX ;; *-*-nto*) platform=QNX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; debian/patches/kfreebsd-reconf.patch0000664000000000000000000000340111243616760014703 0ustar Index: xerces-c-src_2_8_0/samples/configure =================================================================== --- xerces-c-src_2_8_0.orig/samples/configure 2009-06-11 21:05:11.305610095 -0400 +++ xerces-c-src_2_8_0/samples/configure 2009-06-11 21:05:12.122109346 -0400 @@ -4233,6 +4233,7 @@ *-*-sysv5uw7*) platform=UNIXWARE ;; *-*-beos*) platform=BEOS ;; *-*-linux*) platform=LINUX ;; + *-*-k*bsd*) platform=LINUX ;; *-*-nto*) platform=QNX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; Index: xerces-c-src_2_8_0/src/xercesc/configure =================================================================== --- xerces-c-src_2_8_0.orig/src/xercesc/configure 2009-06-11 21:05:11.313609742 -0400 +++ xerces-c-src_2_8_0/src/xercesc/configure 2009-06-11 21:05:12.126111020 -0400 @@ -3942,6 +3942,7 @@ *-*-beos*) platform=BEOS ;; *-*-nto*) platform=QNX ;; *-*-linux*) platform=LINUX ;; + *-*-k*bsd*) platform=LINUX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; *-*-irix*) platform=IRIX ;; Index: xerces-c-src_2_8_0/tests/configure =================================================================== --- xerces-c-src_2_8_0.orig/tests/configure 2009-06-11 21:05:11.325609751 -0400 +++ xerces-c-src_2_8_0/tests/configure 2009-06-11 21:05:12.129660338 -0400 @@ -4233,6 +4233,7 @@ *-*-sysv5uw7*) platform=UNIXWARE ;; *-*-beos*) platform=BEOS ;; *-*-linux*) platform=LINUX ;; + *-*-k*bsd*) platform=LINUX ;; *-*-nto*) platform=QNX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; debian/patches/gnu.patch0000664000000000000000000000560211243616760012442 0ustar Index: xerces-c-src_2_8_0/src/xercesc/configure.in =================================================================== --- xerces-c-src_2_8_0.orig/src/xercesc/configure.in 2009-06-11 21:05:11.549609401 -0400 +++ xerces-c-src_2_8_0/src/xercesc/configure.in 2009-06-11 21:05:11.861610152 -0400 @@ -36,6 +36,7 @@ *-*-nto*) platform=QNX ;; *-*-linux*) platform=LINUX ;; *-*-k*bsd*) platform=LINUX ;; + *-*-gnu*) platform=LINUX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; *-*-irix*) platform=IRIX ;; Index: xerces-c-src_2_8_0/src/xercesc/util/AutoSense.hpp =================================================================== --- xerces-c-src_2_8_0.orig/src/xercesc/util/AutoSense.hpp 2009-06-11 21:05:11.549609401 -0400 +++ xerces-c-src_2_8_0/src/xercesc/util/AutoSense.hpp 2009-06-11 21:05:11.869609510 -0400 @@ -62,6 +62,9 @@ #elif defined(__GLIBC__) #define XML_LINUX #define XML_UNIX +#elif defined(__GNU__) + #define XML_LINUX + #define XML_UNIX #elif defined(__FreeBSD__) #define XML_FREEBSD #define XML_UNIX Index: xerces-c-src_2_8_0/tests/configure.in =================================================================== --- xerces-c-src_2_8_0.orig/tests/configure.in 2009-06-11 21:05:11.549609401 -0400 +++ xerces-c-src_2_8_0/tests/configure.in 2009-06-11 21:05:11.869609510 -0400 @@ -39,6 +39,7 @@ *-*-beos*) platform=BEOS ;; *-*-linux*) platform=LINUX ;; *-*-k*bsd*) platform=LINUX ;; + *-*-gnu*) platform=LINUX ;; *-*-nto*) platform=QNX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; Index: xerces-c-src_2_8_0/samples/configure.in =================================================================== --- xerces-c-src_2_8_0.orig/samples/configure.in 2009-06-11 21:05:11.541609859 -0400 +++ xerces-c-src_2_8_0/samples/configure.in 2009-06-11 21:05:11.873609747 -0400 @@ -39,6 +39,7 @@ *-*-beos*) platform=BEOS ;; *-*-linux*) platform=LINUX ;; *-*-k*bsd*) platform=LINUX ;; + *-*-gnu*) platform=LINUX ;; *-*-nto*) platform=QNX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; Index: xerces-c-src_2_8_0/src/xercesc/util/Platforms/Linux/LinuxPlatformUtils.cpp =================================================================== --- xerces-c-src_2_8_0.orig/src/xercesc/util/Platforms/Linux/LinuxPlatformUtils.cpp 2009-06-11 21:05:11.549609401 -0400 +++ xerces-c-src_2_8_0/src/xercesc/util/Platforms/Linux/LinuxPlatformUtils.cpp 2009-06-11 21:05:11.877609709 -0400 @@ -32,6 +32,10 @@ #error _GNU_SOURCE is not defined in your compile settings #endif +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + #include #include #include debian/patches/gnu-reconf.patch0000664000000000000000000000337411243616760013720 0ustar Index: xerces-c-src_2_8_0/src/xercesc/configure =================================================================== --- xerces-c-src_2_8_0.orig/src/xercesc/configure 2009-06-11 21:05:12.126111020 -0400 +++ xerces-c-src_2_8_0/src/xercesc/configure 2009-06-11 21:05:12.345609604 -0400 @@ -3943,6 +3943,7 @@ *-*-nto*) platform=QNX ;; *-*-linux*) platform=LINUX ;; *-*-k*bsd*) platform=LINUX ;; + *-*-gnu*) platform=LINUX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; *-*-irix*) platform=IRIX ;; Index: xerces-c-src_2_8_0/tests/configure =================================================================== --- xerces-c-src_2_8_0.orig/tests/configure 2009-06-11 21:05:12.129660338 -0400 +++ xerces-c-src_2_8_0/tests/configure 2009-06-11 21:05:12.353639876 -0400 @@ -4234,6 +4234,7 @@ *-*-beos*) platform=BEOS ;; *-*-linux*) platform=LINUX ;; *-*-k*bsd*) platform=LINUX ;; + *-*-gnu*) platform=LINUX ;; *-*-nto*) platform=QNX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; Index: xerces-c-src_2_8_0/samples/configure =================================================================== --- xerces-c-src_2_8_0.orig/samples/configure 2009-06-11 21:05:12.122109346 -0400 +++ xerces-c-src_2_8_0/samples/configure 2009-06-11 21:05:12.357649932 -0400 @@ -4234,6 +4234,7 @@ *-*-beos*) platform=BEOS ;; *-*-linux*) platform=LINUX ;; *-*-k*bsd*) platform=LINUX ;; + *-*-gnu*) platform=LINUX ;; *-*-nto*) platform=QNX ;; *-*-freebsd*) platform=FREEBSD ;; *-*-netbsd*) platform=NETBSD ;; debian/patches/series0000664000000000000000000000013111244525652012035 0ustar kfreebsd.patch gnu.patch kfreebsd-reconf.patch gnu-reconf.patch CVE-2009-1885.patch debian/libxerces-c2-doc.README.Debian0000664000000000000000000000037310771252505014264 0ustar The file "index.html" here contains a redirect to xml.apache.org, Apache's top-level xml site. The top-level file for the documentation for this package may be found in html/index.html. -- Jay Berkenbilt , Tue Mar 22 19:45:47 2005 debian/compat0000664000000000000000000000000211773445157010404 0ustar 9 debian/libxerces-c28.shlibs0000664000000000000000000000007710771253675012771 0ustar libxerces-c 28 libxerces-c28 libxerces-depdom 28 libxerces-c28 debian/libxerces-c28.README.Debian0000664000000000000000000000020010771253634013602 0ustar This version of the Xerces-C++ library uses the ICU transcoder. -- Jay Berkenbilt , Sat Nov 5 11:24:10 2005