Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
podofo.8856
r1920-ADDED-Cycle-detection-for-XRef-tables.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File r1920-ADDED-Cycle-detection-for-XRef-tables.patch of Package podofo.8856
------------------------------------------------------------------------ r1920 | domseichter | 2018-04-14 09:45:49 +0200 (sáb, 14 abr 2018) | 1 line ADDED: Cycle detection for XRef tables. Index: src/base/PdfParser.cpp =================================================================== --- src/base/PdfParser.cpp (revision 1919) +++ src/base/PdfParser.cpp (revision 1920) @@ -645,6 +645,20 @@ long long nFirstObject = 0; long long nNumObjects = 0; + if( m_visitedXRefOffsets.find( lOffset ) != m_visitedXRefOffsets.end() ) + { + std::ostringstream oss; + oss << "Cycle in xref structure. Offset " + << lOffset << " already visited."; + + PODOFO_RAISE_ERROR_INFO( ePdfError_InvalidXRef, oss.str() ); + } + else + { + m_visitedXRefOffsets.insert( lOffset ); + } + + size_t curPosition = m_device.Device()->Tell(); m_device.Device()->Seek(0,std::ios_base::end); std::streamoff fileSize = m_device.Device()->Tell(); Index: src/base/PdfParser.h =================================================================== --- src/base/PdfParser.h (revision 1919) +++ src/base/PdfParser.h (revision 1920) @@ -594,6 +594,8 @@ int m_nReadNextTrailerLevel; static long s_nMaxObjects; + + std::set<pdf_long> m_visitedXRefOffsets; }; // ----------------------------------------------------- ------------------------------------------------------------------------
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor