From 8c02d30eec7ff5d349252650f515842886133c82 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 04:53:38 +0000 Subject: import xerces-c-3.1.1-9.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7dc313 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/xerces-c-3.1.1.tar.gz diff --git a/.xerces-c.metadata b/.xerces-c.metadata new file mode 100644 index 0000000..4488a5f --- /dev/null +++ b/.xerces-c.metadata @@ -0,0 +1 @@ +177ec838c5119df57ec77eddec9a29f7e754c8b2 SOURCES/xerces-c-3.1.1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/XMLReader.cpp.patch b/SOURCES/XMLReader.cpp.patch new file mode 100644 index 0000000..d315af5 --- /dev/null +++ b/SOURCES/XMLReader.cpp.patch @@ -0,0 +1,57 @@ +diff -urNp xerces-c-3.1.1/src/xercesc/internal/XMLReader.cpp xerces-c-3.1.1-patch/src/xercesc/internal/XMLReader.cpp +--- xerces-c-3.1.1/src/xercesc/internal/XMLReader.cpp 2010-01-20 12:06:14.000000000 -0500 ++++ xerces-c-3.1.1-patch/src/xercesc/internal/XMLReader.cpp 2015-06-22 12:20:22.131498873 -0400 +@@ -1460,6 +1460,17 @@ void XMLReader::doInitDecode() + + while (fRawBufIndex < fRawBytesAvail) + { ++ // Security fix: make sure there are at least sizeof(UCS4Ch) bytes to consume. ++ if (fRawBufIndex + sizeof(UCS4Ch) > fRawBytesAvail) { ++ ThrowXMLwithMemMgr1 ++ ( ++ TranscodingException ++ , XMLExcepts::Reader_CouldNotDecodeFirstLine ++ , fSystemId ++ , fMemoryManager ++ ); ++ } ++ + // Get out the current 4 byte value and inc our raw buf index + UCS4Ch curVal = *asUCS++; + fRawBufIndex += sizeof(UCS4Ch); +@@ -1619,6 +1630,17 @@ void XMLReader::doInitDecode() + + while (fRawBufIndex < fRawBytesAvail) + { ++ // Security fix: make sure there are at least sizeof(UTF16Ch) bytes to consume. ++ if (fRawBufIndex + sizeof(UTF16Ch) > fRawBytesAvail) { ++ ThrowXMLwithMemMgr1 ++ ( ++ TranscodingException ++ , XMLExcepts::Reader_CouldNotDecodeFirstLine ++ , fSystemId ++ , fMemoryManager ++ ); ++ } ++ + // Get out the current 2 byte value + UTF16Ch curVal = *asUTF16++; + fRawBufIndex += sizeof(UTF16Ch); +@@ -1708,6 +1730,17 @@ void XMLReader::doInitDecode() + // + void XMLReader::refreshRawBuffer() + { ++ // Security fix: make sure we don't underflow on the subtraction. ++ if (fRawBufIndex > fRawBytesAvail) { ++ ThrowXMLwithMemMgr1 ++ ( ++ RuntimeException ++ , XMLExcepts::Str_StartIndexPastEnd ++ , fSystemId ++ , fMemoryManager ++ ); ++ } ++ + // + // If there are any bytes left, move them down to the start. There + // should only ever be (max bytes per char - 1) at the most. diff --git a/SOURCES/xerces-c-CVE-2016-0729.patch b/SOURCES/xerces-c-CVE-2016-0729.patch new file mode 100644 index 0000000..8bb187d --- /dev/null +++ b/SOURCES/xerces-c-CVE-2016-0729.patch @@ -0,0 +1,394 @@ +diff -urNp xerces-c-3.1.1-patched/src/xercesc/internal/XMLReader.cpp xerces-c-3.1.1-patched-modified/src/xercesc/internal/XMLReader.cpp +--- xerces-c-3.1.1-patched/src/xercesc/internal/XMLReader.cpp 2016-03-03 11:14:06.855482706 -0500 ++++ xerces-c-3.1.1-patched-modified/src/xercesc/internal/XMLReader.cpp 2016-03-03 11:46:23.305567446 -0500 +@@ -1460,8 +1460,30 @@ void XMLReader::doInitDecode() + + while (fRawBufIndex < fRawBytesAvail) + { +- // Security fix: make sure there are at least sizeof(UCS4Ch) bytes to consume. ++ // Make sure there are at least sizeof(UCS4Ch) bytes to consume. + if (fRawBufIndex + sizeof(UCS4Ch) > fRawBytesAvail) { ++ fCharsAvail = 0; ++ fRawBufIndex = 0; ++ fMemoryManager->deallocate(fPublicId); ++ fMemoryManager->deallocate(fEncodingStr); ++ ArrayJanitor janValue(fSystemId, fMemoryManager); ++ ThrowXMLwithMemMgr1 ++ ( ++ TranscodingException ++ , XMLExcepts::Reader_CouldNotDecodeFirstLine ++ , fSystemId ++ , fMemoryManager ++ ); ++ } ++ ++ // Make sure we don't exhaust the limited prolog buffer size. ++ // Leave room for a space added at the end of this function. ++ if (fCharsAvail == kCharBufSize - 1) { ++ fCharsAvail = 0; ++ fRawBufIndex = 0; ++ fMemoryManager->deallocate(fPublicId); ++ fMemoryManager->deallocate(fEncodingStr); ++ ArrayJanitor janValue(fSystemId, fMemoryManager); + ThrowXMLwithMemMgr1 + ( + TranscodingException +@@ -1547,6 +1569,23 @@ void XMLReader::doInitDecode() + const char curCh = *asChars++; + fRawBufIndex++; + ++ // Make sure we don't exhaust the limited prolog buffer size. ++ // Leave room for a space added at the end of this function. ++ if (fCharsAvail == kCharBufSize - 1) { ++ fCharsAvail = 0; ++ fRawBufIndex = 0; ++ fMemoryManager->deallocate(fPublicId); ++ fMemoryManager->deallocate(fEncodingStr); ++ ArrayJanitor janValue(fSystemId, fMemoryManager); ++ ThrowXMLwithMemMgr1 ++ ( ++ TranscodingException ++ , XMLExcepts::Reader_CouldNotDecodeFirstLine ++ , fSystemId ++ , fMemoryManager ++ ); ++ } ++ + // Looks ok, so store it + fCharSizeBuf[fCharsAvail] = 1; + fCharBuf[fCharsAvail++] = XMLCh(curCh); +@@ -1630,8 +1669,30 @@ void XMLReader::doInitDecode() + + while (fRawBufIndex < fRawBytesAvail) + { +- // Security fix: make sure there are at least sizeof(UTF16Ch) bytes to consume. ++ // Make sure there are at least sizeof(UTF16Ch) bytes to consume. + if (fRawBufIndex + sizeof(UTF16Ch) > fRawBytesAvail) { ++ fCharsAvail = 0; ++ fRawBufIndex = 0; ++ fMemoryManager->deallocate(fPublicId); ++ fMemoryManager->deallocate(fEncodingStr); ++ ArrayJanitor janValue(fSystemId, fMemoryManager); ++ ThrowXMLwithMemMgr1 ++ ( ++ TranscodingException ++ , XMLExcepts::Reader_CouldNotDecodeFirstLine ++ , fSystemId ++ , fMemoryManager ++ ); ++ } ++ ++ // Make sure we don't exhaust the limited prolog buffer size. ++ // Leave room for a space added at the end of this function. ++ if (fCharsAvail == kCharBufSize - 1) { ++ fCharsAvail = 0; ++ fRawBufIndex = 0; ++ fMemoryManager->deallocate(fPublicId); ++ fMemoryManager->deallocate(fEncodingStr); ++ ArrayJanitor janValue(fSystemId, fMemoryManager); + ThrowXMLwithMemMgr1 + ( + TranscodingException +@@ -1676,6 +1737,24 @@ void XMLReader::doInitDecode() + const XMLCh chCur = XMLEBCDICTranscoder::xlatThisOne(*srcPtr++); + fRawBufIndex++; + ++ // Make sure we don't exhaust the limited prolog buffer size. ++ // Leave room for a space added at the end of this function. ++ if (fCharsAvail == kCharBufSize - 1) { ++ fCharsAvail = 0; ++ fRawBufIndex = 0; ++ fMemoryManager->deallocate(fPublicId); ++ fMemoryManager->deallocate(fEncodingStr); ++ ArrayJanitor janValue(fSystemId, fMemoryManager); ++ ThrowXMLwithMemMgr1 ++ ( ++ TranscodingException ++ , XMLExcepts::Reader_CouldNotDecodeFirstLine ++ , fSystemId ++ , fMemoryManager ++ ); ++ } ++ ++ + // + // And put it into the character buffer. This stuff has to + // look like it was normally transcoded. +@@ -1730,7 +1809,7 @@ void XMLReader::doInitDecode() + // + void XMLReader::refreshRawBuffer() + { +- // Security fix: make sure we don't underflow on the subtraction. ++ // Make sure we don't underflow on the subtraction. + if (fRawBufIndex > fRawBytesAvail) { + ThrowXMLwithMemMgr1 + ( +diff -urNp xerces-c-3.1.1-patched/src/xercesc/util/XMLUri.cpp xerces-c-3.1.1-patched-modified/src/xercesc/util/XMLUri.cpp +--- xerces-c-3.1.1-patched/src/xercesc/util/XMLUri.cpp 2016-03-03 11:13:54.871619517 -0500 ++++ xerces-c-3.1.1-patched-modified/src/xercesc/util/XMLUri.cpp 2016-03-03 11:30:38.593240739 -0500 +@@ -875,11 +875,21 @@ void XMLUri::initializePath(const XMLCh* + // check for valid escape sequence + if (testChar == chPercent) + { +- if (index+2 >= end || +- !XMLString::isHex(uriSpec[index+1]) || +- !XMLString::isHex(uriSpec[index+2])) ++ if (index + 2 >= end) + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[3]; ++ value1[1] = chNull; ++ value1[2] = chNull; ++ XMLString::moveChars(value1, &(uriSpec[index]), (index + 1 >= end ? 1 : 2)); ++ ThrowXMLwithMemMgr2(MalformedURLException ++ , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence ++ , errMsg_PATH ++ , value1 ++ , fMemoryManager); ++ } ++ else if (!XMLString::isHex(uriSpec[index+1]) || !XMLString::isHex(uriSpec[index+2])) ++ { ++ XMLCh value1[4]; + XMLString::moveChars(value1, &(uriSpec[index]), 3); + value1[3] = chNull; + ThrowXMLwithMemMgr2(MalformedURLException +@@ -892,7 +902,7 @@ void XMLUri::initializePath(const XMLCh* + else if (!isUnreservedCharacter(testChar) && + !isPathCharacter(testChar)) + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[2]; + value1[0] = testChar; + value1[1] = chNull; + ThrowXMLwithMemMgr2(MalformedURLException +@@ -920,11 +930,21 @@ void XMLUri::initializePath(const XMLCh* + // check for valid escape sequence + if (testChar == chPercent) + { +- if (index+2 >= end || +- !XMLString::isHex(uriSpec[index+1]) || +- !XMLString::isHex(uriSpec[index+2])) ++ if (index + 2 >= end) + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[3]; ++ value1[1] = chNull; ++ value1[2] = chNull; ++ XMLString::moveChars(value1, &(uriSpec[index]), (index + 1 >= end ? 1 : 2)); ++ ThrowXMLwithMemMgr2(MalformedURLException ++ , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence ++ , errMsg_PATH ++ , value1 ++ , fMemoryManager); ++ } ++ else if (!XMLString::isHex(uriSpec[index+1]) || !XMLString::isHex(uriSpec[index+2])) ++ { ++ XMLCh value1[4]; + XMLString::moveChars(value1, &(uriSpec[index]), 3); + value1[3] = chNull; + ThrowXMLwithMemMgr2(MalformedURLException +@@ -941,7 +961,7 @@ void XMLUri::initializePath(const XMLCh* + // contains '[' and ']'. + else if (!isReservedOrUnreservedCharacter(testChar)) + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[2]; + value1[0] = testChar; + value1[1] = chNull; + ThrowXMLwithMemMgr2(MalformedURLException +@@ -979,11 +999,21 @@ void XMLUri::initializePath(const XMLCh* + + if (testChar == chPercent) + { +- if (index+2 >= end || +- !XMLString::isHex(uriSpec[index+1]) || +- !XMLString::isHex(uriSpec[index+2])) ++ if (index + 2 >= end) ++ { ++ XMLCh value1[3]; ++ value1[1] = chNull; ++ value1[2] = chNull; ++ XMLString::moveChars(value1, &(uriSpec[index]), (index + 1 >= end ? 1 : 2)); ++ ThrowXMLwithMemMgr2(MalformedURLException ++ , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence ++ , errMsg_QUERY ++ , value1 ++ , fMemoryManager); ++ } ++ if (!XMLString::isHex(uriSpec[index+1]) || !XMLString::isHex(uriSpec[index+2])) + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[4]; + XMLString::moveChars(value1, &(uriSpec[index]), 3); + value1[3] = chNull; + ThrowXMLwithMemMgr2(MalformedURLException +@@ -995,7 +1025,7 @@ void XMLUri::initializePath(const XMLCh* + } + else if (!isReservedOrUnreservedCharacter(testChar)) + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[2]; + value1[0] = testChar; + value1[1] = chNull; + ThrowXMLwithMemMgr2(MalformedURLException +@@ -1030,11 +1060,21 @@ void XMLUri::initializePath(const XMLCh* + + if (testChar == chPercent) + { +- if (index+2 >= end || +- !XMLString::isHex(uriSpec[index+1]) || +- !XMLString::isHex(uriSpec[index+2])) ++ if (index + 2 >= end) ++ { ++ XMLCh value1[3]; ++ value1[1] = chNull; ++ value1[2] = chNull; ++ XMLString::moveChars(value1, &(uriSpec[index]), (index + 1 >= end ? 1 : 2)); ++ ThrowXMLwithMemMgr2(MalformedURLException ++ , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence ++ , errMsg_FRAGMENT ++ , value1 ++ , fMemoryManager); ++ } ++ if (!XMLString::isHex(uriSpec[index+1]) || !XMLString::isHex(uriSpec[index+2])) + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[4]; + XMLString::moveChars(value1, &(uriSpec[index]), 3); + value1[3] = chNull; + ThrowXMLwithMemMgr2(MalformedURLException +@@ -1046,7 +1086,7 @@ void XMLUri::initializePath(const XMLCh* + } + else if (!isReservedOrUnreservedCharacter(testChar)) + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[2]; + value1[0] = testChar; + value1[1] = chNull; + ThrowXMLwithMemMgr2(MalformedURLException +@@ -1410,14 +1450,15 @@ void XMLUri::isConformantUserInfo(const + } + else if (*tmpStr == chPercent) // '%' + { +- if (XMLString::isHex(*(tmpStr+1)) && // 1st hex +- XMLString::isHex(*(tmpStr+2)) ) // 2nd hex ++ if (XMLString::stringLen(tmpStr) >= 3 ++ && XMLString::isHex(*(tmpStr+1)) // 1st hex ++ && XMLString::isHex(*(tmpStr+2)) ) // 2nd hex + { + tmpStr+=3; + } + else + { +- XMLCh value1[BUF_LEN+1]; ++ XMLCh value1[4]; + value1[0] = chPercent; + value1[1] = *(tmpStr+1); + value1[2] = *(tmpStr+2); +@@ -1468,8 +1509,9 @@ bool XMLUri::isValidServerBasedAuthority + } + else if (userinfo[index] == chPercent) // '%' + { +- if (XMLString::isHex(userinfo[index+1]) && // 1st hex +- XMLString::isHex(userinfo[index+2]) ) // 2nd hex ++ if (index + 2 < userLen ++ && XMLString::isHex(userinfo[index+1]) // 1st hex ++ && XMLString::isHex(userinfo[index+2]) ) // 2nd hex + index +=3; + else + return false; +@@ -1508,8 +1550,9 @@ bool XMLUri::isValidServerBasedAuthority + } + else if (*tmpStr == chPercent) // '%' + { +- if (XMLString::isHex(*(tmpStr+1)) && // 1st hex +- XMLString::isHex(*(tmpStr+2)) ) // 2nd hex ++ if (XMLString::stringLen(tmpStr) >= 3 ++ && XMLString::isHex(*(tmpStr+1)) // 1st hex ++ && XMLString::isHex(*(tmpStr+2)) ) // 2nd hex + { + tmpStr+=3; + } +@@ -1537,8 +1580,9 @@ bool XMLUri::isValidRegistryBasedAuthori + } + else if (authority[index] == chPercent) // '%' + { +- if (XMLString::isHex(authority[index+1]) && // 1st hex +- XMLString::isHex(authority[index+2]) ) // 2nd hex ++ if (index + 2 < authLen ++ && XMLString::isHex(authority[index+1]) // 1st hex ++ && XMLString::isHex(authority[index+2]) ) // 2nd hex + index +=3; + else + return false; +@@ -1566,8 +1610,9 @@ bool XMLUri::isValidRegistryBasedAuthori + } + else if (*tmpStr == chPercent) // '%' + { +- if (XMLString::isHex(*(tmpStr+1)) && // 1st hex +- XMLString::isHex(*(tmpStr+2)) ) // 2nd hex ++ if (XMLString::stringLen(tmpStr) >= 3 ++ && XMLString::isHex(*(tmpStr + 1)) // 1st hex ++ && XMLString::isHex(*(tmpStr + 2))) // 2nd hex + { + tmpStr+=3; + } +@@ -1602,8 +1647,9 @@ bool XMLUri::isURIString(const XMLCh* co + } + else if (*tmpStr == chPercent) // '%' + { +- if (XMLString::isHex(*(tmpStr+1)) && // 1st hex +- XMLString::isHex(*(tmpStr+2)) ) // 2nd hex ++ if (XMLString::stringLen(tmpStr) >=3 ++ && XMLString::isHex(*(tmpStr+1)) // 1st hex ++ && XMLString::isHex(*(tmpStr+2)) ) // 2nd hex + { + tmpStr+=3; + } +diff -urNp xerces-c-3.1.1-patched/src/xercesc/util/XMLURL.cpp xerces-c-3.1.1-patched-modified/src/xercesc/util/XMLURL.cpp +--- xerces-c-3.1.1-patched/src/xercesc/util/XMLURL.cpp 2016-03-03 11:13:54.871619517 -0500 ++++ xerces-c-3.1.1-patched-modified/src/xercesc/util/XMLURL.cpp 2016-03-03 11:44:08.553089142 -0500 +@@ -117,8 +117,8 @@ static const XMLCh gListSix[] = { chP + static bool isHexDigit(const XMLCh toCheck) + { + if (((toCheck >= chDigit_0) && (toCheck <= chDigit_9)) +- || ((toCheck >= chLatin_A) && (toCheck <= chLatin_Z)) +- || ((toCheck >= chLatin_a) && (toCheck <= chLatin_z))) ++ || ((toCheck >= chLatin_A) && (toCheck <= chLatin_F)) ++ || ((toCheck >= chLatin_a) && (toCheck <= chLatin_f))) + { + return true; + } +@@ -130,7 +130,7 @@ static unsigned int xlatHexDigit(const X + if ((toXlat >= chDigit_0) && (toXlat <= chDigit_9)) + return (unsigned int)(toXlat - chDigit_0); + +- if ((toXlat >= chLatin_A) && (toXlat <= chLatin_Z)) ++ if ((toXlat >= chLatin_A) && (toXlat <= chLatin_F)) + return (unsigned int)(toXlat - chLatin_A) + 10; + + return (unsigned int)(toXlat - chLatin_a) + 10; +@@ -611,9 +611,20 @@ BinInputStream* XMLURL::makeNewStream() + + while (percentIndex != -1) { + +- if (percentIndex+2 >= (int)end || +- !isHexDigit(realPath[percentIndex+1]) || +- !isHexDigit(realPath[percentIndex+2])) ++ // Isolate the length/boundary check so we don't try and copy off the end. ++ if (percentIndex+2 >= (int)end) ++ { ++ XMLCh value1[3]; ++ value1[1] = chNull; ++ value1[2] = chNull; ++ XMLString::moveChars(value1, &(realPath[percentIndex]), (percentIndex + 1 >= (int)end ? 1 : 2)); ++ ThrowXMLwithMemMgr2(MalformedURLException ++ , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence ++ , realPath ++ , value1 ++ , fMemoryManager); ++ } ++ else if (!isHexDigit(realPath[percentIndex+1]) || !isHexDigit(realPath[percentIndex+2])) + { + XMLCh value1[4]; + XMLString::moveChars(value1, &(realPath[percentIndex]), 3); diff --git a/SOURCES/xerces-c-CVE-2016-4463.patch b/SOURCES/xerces-c-CVE-2016-4463.patch new file mode 100644 index 0000000..abe08f3 --- /dev/null +++ b/SOURCES/xerces-c-CVE-2016-4463.patch @@ -0,0 +1,72 @@ +--- xerces-c-3.1.1-patched/src/xercesc/validators/DTD/DTDScanner.cpp 2016/06/10 01:28:38 1747618 ++++ xerces-c-3.1.1-patched-modified/src/xercesc/validators/DTD/DTDScanner.cpp 2016/06/10 01:38:34 1747619 +@@ -44,6 +44,8 @@ + + XERCES_CPP_NAMESPACE_BEGIN + ++#define CONTENTSPEC_DEPTH_LIMIT 1000 ++ + // --------------------------------------------------------------------------- + // Local methods + // --------------------------------------------------------------------------- +@@ -1038,8 +1040,13 @@ + + + ContentSpecNode* +-DTDScanner::scanChildren(const DTDElementDecl& elemDecl, XMLBuffer& bufToUse) ++DTDScanner::scanChildren(const DTDElementDecl& elemDecl, XMLBuffer& bufToUse, unsigned int& depth) + { ++ if (depth++ > CONTENTSPEC_DEPTH_LIMIT) { ++ fScanner->emitError(XMLErrs::UnterminatedDOCTYPE); ++ return 0; ++ } ++ + // Check for a PE ref here, but don't require spaces + checkForPERef(false, true); + +@@ -1240,7 +1247,7 @@ + // Recurse to handle this new guy + ContentSpecNode* subNode; + try { +- subNode = scanChildren(elemDecl, bufToUse); ++ subNode = scanChildren(elemDecl, bufToUse, depth); + } + catch (const XMLErrs::Codes) + { +@@ -1577,7 +1584,8 @@ + // + toFill.setModelType(DTDElementDecl::Children); + XMLBufBid bbTmp(fBufMgr); +- ContentSpecNode* resNode = scanChildren(toFill, bbTmp.getBuffer()); ++ unsigned int depth = 0; ++ ContentSpecNode* resNode = scanChildren(toFill, bbTmp.getBuffer(), depth); + status = (resNode != 0); + if (status) + toFill.setContentSpec(resNode); +@@ -2509,7 +2517,15 @@ + { + while (true) + { +- const XMLCh nextCh = fReaderMgr->peekNextChar(); ++ XMLCh nextCh; ++ ++ try { ++ nextCh = fReaderMgr->peekNextChar(); ++ } ++ catch (XMLException& ex) { ++ fScanner->emitError(XMLErrs::XMLException_Fatal, ex.getCode(), ex.getMessage(), NULL, NULL); ++ nextCh = chNull; ++ } + + if (!nextCh) + { +--- xerces-c-3.1.1-patched/src/xercesc/validators/DTD/DTDScanner.hpp 2016/06/10 01:28:38 1747618 ++++ xerces-c-3.1.1-patched-modified/src/xercesc/validators/DTD/DTDScanner.hpp 2016/06/10 01:38:34 1747619 +@@ -143,6 +143,7 @@ + ( + const DTDElementDecl& elemDecl + , XMLBuffer& bufToUse ++ , unsigned int& depth + ); + bool scanCharRef(XMLCh& toFill, XMLCh& second); + void scanComment(); diff --git a/SPECS/xerces-c.spec b/SPECS/xerces-c.spec new file mode 100644 index 0000000..aea7057 --- /dev/null +++ b/SPECS/xerces-c.spec @@ -0,0 +1,208 @@ +Summary: Validating XML Parser +Name: xerces-c +Version: 3.1.1 +Release: 9%{?dist} +License: ASL 2.0 +Group: System Environment/Libraries +URL: http://xml.apache.org/xerces-c/ +Source0: http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch1: XMLReader.cpp.patch +Patch2: xerces-c-CVE-2016-0729.patch +Patch3: xerces-c-CVE-2016-4463.patch + +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 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +# 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 -k *.xml; popd +# Remove unwanted binaries +rm -rf $RPM_BUILD_ROOT%{_bindir} +# Remove .la files +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +%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 +* Wed Sep 05 2018 Robbie Harwood - 3.1.1-9 +- Fix CVE-2016-4463 +- Resolves: #1534481 + +* Thu Mar 03 2016 Avesh Agarwal - 3.1.1-8 +Resolves: CVE-2016-0729 + +* Mon Jun 22 2015 Avesh Agarwal - 3.1.1-7 +Resolves: rhbz#1217105 CVE-2015-0252 + +* Fri Jan 24 2014 Daniel Mach - 3.1.1-6 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 3.1.1-5 +- Mass rebuild 2013-12-27 + +* Tue Sep 10 2013 Avesh Agarwal - 3.1.1-4 +- Rebuilding for rhel7 + +* Sun Jul 22 2012 Fedora Release Engineering - 3.1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 3.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Mar 09 2011 Kalev Lember - 3.1.1-1 +- Update to 3.1.1 +- Dropped CVE-2009-1885 patch. +- Use dos2unix -k instead of unrecognized option -U +- Removed the multilib conflict workaround as Xerces_autoconf_config.hpp + no longer contains the conflicting XERCES_SIZEOF_LONG define. + +* Mon Feb 07 2011 Fedora Release Engineering - 3.0.1-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Jul 9 2010 Jonathan Robie - 3.0.1-20 +- Added no-strict-aliasing flag to stop rpmdiff from griping + +* Wed May 26 2010 Kalev Lember 3.0.1-19 +- Fix multilib conflict caused by Xerces_autoconf_config.hpp (#595923) + +* Fri May 14 2010 Kalev Lember 3.0.1-18 +- Build -doc subpackage as noarch + +* Fri May 14 2010 Kalev Lember 3.0.1-17 +- Disable explicit -msse2 to make sure the binaries run on non-SSE2 i686 + +* Sun Feb 07 2010 Kalev Lember 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 3.0.1-15 +- Corrected .spec file + +* Wed Feb 3 2010 Jonathan Robie 3.0.1-1 +- Move to Xerces 3.0.1. + +* Thu Aug 6 2009 Peter Lemenkov 2.8.0-5 +- Fix CVE-2009-1885 + +* Mon Jul 27 2009 Fedora Release Engineering - 2.8.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 2.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Jun 30 2008 Peter Lemenkov 2.8.0-2 +- Spec cleanups ( https://bugzilla.redhat.com/show_bug.cgi?id=435132 ) + +* Sun Feb 10 2008 Peter Lemenkov 2.8.0-1 +- Ver. 2.8.0 + +* Sat Nov 25 2006 Peter Lemenkov 2.7.0-6 +- typo fix + +* Sat Nov 25 2006 Peter Lemenkov 2.7.0-5 +- fixed some rpmlint warnings + +* Fri Nov 24 2006 Peter Lemenkov 2.7.0-4 +- Added samples to docs-package + +* Sat Nov 18 2006 Peter Lemenkov 2.7.0-3 +- improvements suggested by Aurelien Bompard + +* Sat Oct 14 2006 Peter Lemenkov 2.7.0-2 +- Disabled package 'samples' + +* Fri Oct 13 2006 Peter Lemenkov 2.7.0-1 +- initial build for FE + +* Fri Jan 06 2006 Dag Wieers - 2.7.0-1 - 3891/dag +- Cleaned SPEC file. + +* Tue Jan 03 2006 Dries Verachtert - 2.7.0-1 +- Updated to release 2.7.0. + +* Thu Sep 22 2005 C.Lee Taylor 2.6.1-1 +- Update to 2.6.1 +- Build for FC4 32/64bit + +* Sat Aug 20 2005 Che +- initial rpm release