[xerces-c/el6] Revert "Package is retired"

Orion Poplawski orion at fedoraproject.org
Wed Jan 11 21:34:16 UTC 2012


commit 1e4e6f3bcb8f22a6b8c4eddc0d84f915ddd490f6
Author: Orion Poplawski <orion at cora.nwra.com>
Date:   Wed Jan 11 14:27:44 2012 -0700

    Revert "Package is retired"
    
    This reverts commit 42712e690324769c8e823866147e4a00bad595c9.

 .gitignore                         |    1 +
 dead.package                       |    1 -
 sources                            |    1 +
 xerces-c-3.0.1-CVE-2009-1885.patch |  648 ++++++++++++++++++++++++++++++++++++
 xerces-c.spec                      |  196 +++++++++++
 5 files changed, 846 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..545a08c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+xerces-c-src_2_8_0.tar.gz
diff --git a/sources b/sources
new file mode 100644
index 0000000..dc8501a
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+293c03f59bf8e956020d73f5b122094c  xerces-c-3.0.1.tar.gz
diff --git a/xerces-c-3.0.1-CVE-2009-1885.patch b/xerces-c-3.0.1-CVE-2009-1885.patch
new file mode 100644
index 0000000..7fe05f1
--- /dev/null
+++ b/xerces-c-3.0.1-CVE-2009-1885.patch
@@ -0,0 +1,648 @@
+--- src/xercesc/validators/DTD/DTDScanner.cpp
++++ src/xercesc/validators/DTD/DTDScanner.cpp
+@@ -27,7 +27,9 @@
+ #include <xercesc/util/FlagJanitor.hpp>
+ #include <xercesc/util/Janitor.hpp>
+ #include <xercesc/util/XMLUniDefs.hpp>
++#include <xercesc/util/ValueStackOf.hpp>
+ #include <xercesc/util/UnexpectedEOFException.hpp>
++#include <xercesc/util/OutOfMemoryException.hpp>
+ #include <xercesc/sax/InputSource.hpp>
+ #include <xercesc/framework/XMLDocumentHandler.hpp>
+ #include <xercesc/framework/XMLEntityHandler.hpp>
+@@ -39,7 +41,6 @@
+ #include <xercesc/validators/DTD/DTDEntityDecl.hpp>
+ #include <xercesc/validators/DTD/DocTypeHandler.hpp>
+ #include <xercesc/validators/DTD/DTDScanner.hpp>
+-#include <xercesc/util/OutOfMemoryException.hpp>
+ 
+ XERCES_CPP_NAMESPACE_BEGIN
+ 
+@@ -1041,338 +1042,354 @@
+     // Check for a PE ref here, but don't require spaces
+     checkForPERef(false, true);
+ 
+-    // We have to check entity nesting here
+-    XMLSize_t curReader;
+-
++    ValueStackOf<XMLSize_t>* 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 XMLSize_t curReader = fReaderMgr->getCurrentReaderNum();
++        if(arrNestedDecl==NULL)
++            arrNestedDecl=new (fMemoryManager) ValueStackOf<XMLSize_t>(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;
++    }
++
++    //
++    //  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);
++    }
++    curNode = new (fGrammarPoolMemoryManager) ContentSpecNode
++    (
++        decl->getElementName()
++        , fGrammarPoolMemoryManager
++    );
++
++    // Check for a PE ref here, but don't require spaces
++    const bool gotSpaces = checkForPERef(false, true);
+ 
+-        if (curReader != fReaderMgr->getCurrentReaderNum() && fScanner->getValidationScheme() == XMLScanner::Val_Always)
+-            fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE);
++    // Check for a repetition character after the leaf
++    XMLCh repCh = fReaderMgr->peekNextChar();
++    ContentSpecNode* tmpNode = makeRepNode(repCh, curNode, fGrammarPoolMemoryManager);
++    if (tmpNode != curNode)
++    {
++        if (gotSpaces)
++        {
++            if (fScanner->emitErrorWillThrowException(XMLErrs::UnexpectedWhitespace))
++            {
++                delete tmpNode;
++            }
++            fScanner->emitError(XMLErrs::UnexpectedWhitespace);
++        }
++        fReaderMgr->getNextChar();
++        curNode = tmpNode;
+     }
+-     else
++
++    while(arrNestedDecl==NULL || !arrNestedDecl->empty())
+     {
+-        // Not a nested paren, so it must be a leaf node
+-        if (!fReaderMgr->getName(bufToUse))
++        // 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))
+         {
+-            fScanner->emitError(XMLErrs::ExpectedElementName);
++            // Not a legal char, so delete our node and return failure
++            delete curNode;
++            fScanner->emitError(XMLErrs::ExpectedSeqChoiceLeaf);
+             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.
++        //  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.
+         //
+-        XMLElementDecl* decl = fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bufToUse.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE);
+-        if (!decl)
++        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())
++                {
++                    // Just skip whitespace
++                    fReaderMgr->skipPastSpaces();
++                }
++                 else if (fReaderMgr->skippedChar(chCloseParen))
+                 {
+-                    if (!curNode->getSecond())
++                    //
++                    //  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 XMLSize_t 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->getValidationScheme() == XMLScanner::Val_Always)
++                            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->getValidationScheme() == XMLScanner::Val_Always)
+-                        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 XMLSize_t 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;
+ }
+ 
+ 
diff --git a/xerces-c.spec b/xerces-c.spec
new file mode 100644
index 0000000..63f6901
--- /dev/null
+++ b/xerces-c.spec
@@ -0,0 +1,196 @@
+Summary:	Validating XML Parser
+Name:		xerces-c
+Version:	3.0.1
+Release:	0.20%{?dist}
+License:	ASL 2.0
+Group:		System Environment/Libraries
+URL:		http://xml.apache.org/xerces-c/
+Source0:	http://archive.apache.org/dist/xml/xerces-c/Xerces-C_3_0_1/sources/xerces-c-3.0.1.tar.gz
+Patch0:		xerces-c-3.0.1-CVE-2009-1885.patch
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+ExclusiveArch:	ppc64
+BuildRequires:	dos2unix
+
+%description 
+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: XML 1.0 (Third Edition), XML 1.1 (First
+Edition), DOM Level 1, 2, 3 Core, DOM Level 2.0 Traversal and Range,
+DOM Level 3.0 Load and Save, SAX 1.0 and SAX 2.0, Namespaces in XML,
+Namespaces in XML 1.1, XML Schema, XML Inclusions).
+
+
+%package	devel
+Summary:	Header files, libraries and development documentation for %{name}
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+This package contains the header files, static libraries and development
+documentation for %{name}. If you like to develop programs using %{name},
+you will need to install %{name}-devel.
+
+%package doc
+Group:		Documentation
+Summary:	Documentation for Xerces-C++ validating XML parser
+BuildArch:	noarch
+
+%description doc
+Documentation for Xerces-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.
+
+%prep
+%setup -q 
+%patch0 -p0 -b .CVE-2009-1885
+# Copy samples before build to avoid including built binaries in -doc package
+mkdir -p _docs
+cp -a samples/ _docs/
+
+%build
+# --disable-sse2 makes sure explicit -msse2 isn't passed to gcc so
+# the binaries would be compatible with non-SSE2 i686 hardware.
+# This only affects i686, as on x86_64 the compiler uses SSE2 by default.
+export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
+export CXXFLAGS="$CFLAGS"
+%configure --disable-static \
+  --disable-pretty-make \
+  --disable-sse2
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR="$RPM_BUILD_ROOT"
+# Correct errors in encoding
+iconv -f iso8859-1 -t utf-8 CREDITS > CREDITS.tmp && mv -f CREDITS.tmp CREDITS
+# Correct errors in line endings
+pushd doc; dos2unix -U *.xml; popd
+# Remove unwanted binaries
+rm -rf $RPM_BUILD_ROOT%{_bindir}
+# Remove .la files
+rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
+
+# Fix multilib conflict
+mv $RPM_BUILD_ROOT%{_includedir}/xercesc/util/Xerces_autoconf_config.hpp \
+   $RPM_BUILD_ROOT%{_includedir}/xercesc/util/Xerces_autoconf_config-%{__isa_bits}.hpp
+
+cat >$RPM_BUILD_ROOT%{_includedir}/xercesc/util/Xerces_autoconf_config.hpp <<EOF
+#ifndef XERCES_C_MULTILIB
+#define XERCES_C_MULTILIB
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+# include "Xerces_autoconf_config-32.hpp"
+#elif __WORDSIZE == 64
+# include "Xerces_autoconf_config-64.hpp"
+#else
+# error "unexpected value for __WORDSIZE macro"
+#endif
+
+#endif 
+EOF
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc LICENSE
+%{_libdir}/libxerces-c-3.*.so
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/libxerces-c.so
+%{_libdir}/pkgconfig/xerces-c.pc
+%{_includedir}/xercesc/
+
+%files doc
+%defattr(-,root,root,-)
+%doc README LICENSE NOTICE CREDITS doc _docs/*
+
+%changelog
+* Thu Jun 23 2011 Volker Fröhlich <volker27 at gmx.at> - 3.0.1-0.20
+- This package was added to EPEL and thus has a release number
+  starting with 0, to keep it older than the RHEL release
+- ExclusiveArch ppc64
+
+* Fri Jul  9 2010 Jonathan Robie <jrobie at localhost.localdomain> - 3.0.1-20
+- Added no-strict-aliasing flag to stop rpmdiff from griping
+
+* Wed May 26 2010 Kalev Lember <kalev at smartlink.ee> 3.0.1-19
+- Fix multilib conflict caused by Xerces_autoconf_config.hpp (#595923)
+
+* Fri May 14 2010 Kalev Lember <kalev at smartlink.ee> 3.0.1-18
+- Build -doc subpackage as noarch
+
+* Fri May 14 2010 Kalev Lember <kalev at smartlink.ee> 3.0.1-17
+- Disable explicit -msse2 to make sure the binaries run on non-SSE2 i686
+
+* Sun Feb 07 2010 Kalev Lember <kalev at smartlink.ee> 3.0.1-16
+- Reintroduce a patch for CVE-2009-1885
+- Don't build static library
+- Use parallel make
+- Spec file clean up
+
+* Thu Feb 4 2010 Jonathan Robie <jonathan.robie at redhat.com> 3.0.1-15
+- Corrected .spec file
+
+* Wed Feb 3 2010 Jonathan Robie <jonathan.robie at redhat.com> 3.0.1-1
+- Move to Xerces 3.0.1.
+
+* Thu Aug  6 2009 Peter Lemenkov <lemenkov at gmail.com> 2.8.0-5
+- Fix CVE-2009-1885
+
+* Mon Jul 27 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.8.0-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Thu Feb 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.8.0-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Mon Jun 30 2008 Peter Lemenkov <lemenkov at gmail.com> 2.8.0-2
+- Spec cleanups ( https://bugzilla.redhat.com/show_bug.cgi?id=435132 )
+
+* Sun Feb 10 2008 Peter Lemenkov <lemenkov at gmail.com> 2.8.0-1
+- Ver. 2.8.0
+
+* Sat Nov 25 2006 Peter Lemenkov <lemenkov at gmail.com> 2.7.0-6
+- typo fix
+
+* Sat Nov 25 2006 Peter Lemenkov <lemenkov at gmail.com> 2.7.0-5
+- fixed some rpmlint warnings
+
+* Fri Nov 24 2006 Peter Lemenkov <lemenkov at gmail.com> 2.7.0-4
+- Added samples to docs-package
+
+* Sat Nov 18 2006 Peter Lemenkov <lemenkov at gmail.com> 2.7.0-3
+- improvements suggested by Aurelien Bompard
+
+* Sat Oct 14 2006 Peter Lemenkov <lemenkov at gmail.com> 2.7.0-2
+- Disabled package 'samples'
+
+* Fri Oct 13 2006 Peter Lemenkov <lemenkov at gmail.com> 2.7.0-1
+- initial build for FE
+
+* Fri Jan 06 2006 Dag Wieers <dag at wieers.com> - 2.7.0-1 - 3891/dag
+- Cleaned SPEC file.
+
+* Tue Jan 03 2006 Dries Verachtert <dries at ulyssis.org> - 2.7.0-1
+- Updated to release 2.7.0.
+
+* Thu Sep 22 2005 C.Lee Taylor <leet at leenx.co.za> 2.6.1-1
+- Update to 2.6.1
+- Build for FC4 32/64bit
+
+* Sat Aug 20 2005 Che
+- initial rpm release


More information about the scm-commits mailing list