[Podofo-users] Extracting Accessible Text

2009-03-19 Thread Mark Rogers
Hi I'm trying to figure out how to extract text from a PDF into an accessibility tool I've figured out how to walk the tagged structure returned by GetStructTreeRoot, but stuck on how to get from an integer marked content identifier (PDF 32000 14.7.2) to the actual text. Looks like I

[Podofo-users] MarkInfo accessor

2010-03-08 Thread Mark Rogers
-1:2008 14.7.1) * \returns PdfObject the MarkInfo dictionary */ PdfObject* GetMarkInfo() const { return GetNamedObjectFromCatalog( MarkInfo ); } Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - http://www.powermapper.com Registered in Scotland

[Podofo-users] Possible bug: error thrown reading PDF version of ISO Standard 32000: Portable Document Format

2010-03-10 Thread Mark Rogers
) Line 160 + 0x3d bytes C++ PoDoFo::PdfMemDocument::PdfMemDocument(const wchar_t * pszFilename=0x03825600) Line 74 C++ Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - http://www.powermapper.com Registered in Scotland No 362274 30-31 Queen Street Edinburgh

[Podofo-users] PODOFO_API and podofo_free in 0.8.0

2010-04-30 Thread Mark Rogers
PdfDefines.h before first include. Only tested on Visual Studio - don't have a linux tool chain currently (but looks correct after a quick scan of the GCC documentation). PS Congratulations on getting the 0.8.0 release out - worked very smoothly apart from this issue. Best Regards Mark Mark Rogers

[Podofo-users] Fixes for access violations

2010-06-02 Thread Mark Rogers
::TypeNameToIndexfaults if ppTypes[] contains sentinel NULL entries and name isn't found Changes: 98 Change: if( strcmp( pszType, ppTypes[i] ) == 0 ) To: if( ppTypes[i] != NULL strcmp( pszType, ppTypes[i] ) == 0 ) Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software

[Podofo-users] Potential problem with Windows DLL

2010-06-25 Thread Mark Rogers
, but that could break a lot of existing code). The other alternative is to require apps to use the shared CRT, but that pulls in other dependencies (e.g. installer merge modules and the broken SxS deployment model) Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software

[Podofo-users] Patch for performance issue

2012-06-21 Thread Mark Rogers
m_nMaxObjects. ); Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL -- Live Security Virtual Conference

[Podofo-users] Patches for access violations

2012-06-21 Thread Mark Rogers
() ) Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL -- Live Security Virtual Conference Exclusive

[Podofo-users] Patch for stack overflow

2012-06-27 Thread Mark Rogers
+ --m_nReadNextTrailerLevel; } Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL -- Live

Re: [Podofo-users] Patch for performance issue

2012-07-15 Thread Mark Rogers
Best Regards Mark -Original Message- From: Dominik Seichter [mailto:domseich...@googlemail.com] Sent: 15 July 2012 08:40 To: Mark Rogers Cc: podofo-users@lists.sourceforge.net Subject: Re: [Podofo-users] Patch for performance issue Hi Mark, I need some context again: .293 added

Re: [Podofo-users] Patch for stack overflow

2012-07-15 Thread Mark Rogers
happy to check the patched files against my version if you email me them, or let me know when they're committed to SVN Best Regards Mark -Original Message- From: Dominik Seichter [mailto:domseich...@googlemail.com] Sent: 15 July 2012 08:36 To: Mark Rogers Cc: podofo-users

[Podofo-users] Patch for heap corruption

2013-02-22 Thread Mark Rogers
, lBufferLen); if ( nFirstObj = 0 nFirstObj m_pOffsets-size() ) if( ! (*m_pOffsets)[static_castint(nFirstObj)].bParsed ) ReadXRefStreamEntry( pBuffer, lBufferLen, nW, static_castint(nFirstObj) ); Best Regards Mark Mark Rogers - mark.rog...@powermapper.com

[Podofo-users] PdfMemDocument sometimes doesn't load object streams (ObjStm)

2013-07-10 Thread Mark Rogers
displaying the PDF in a text editor I'm happy to try to produce a patch, but some pointers on where to start looking for the cause would be much appreciated. Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274

[Podofo-users] Patch to support PDF XRefStm

2014-04-01 Thread Mark Rogers
patch adds support for XRefStm to PdfParser::ReadNextTrailer() by adding code between MergeTrailer( trailer ); and if( trailer.GetDictionary().HasKey( Prev ) ) Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland

[Podofo-users] Patches for hangs and access violations

2014-04-01 Thread Mark Rogers
the Kids array is missing PdfPages.patch Fixes an access violation in PdfPage::GetPageNumber when the Kids array is missing Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL

Re: [Podofo-users] SVN commit 1587 broke ability to parse several PDFs

2014-07-02 Thread Mark Rogers
it assumes is an XRefStm Given that fixing this might uncover more problems, and it’s very close to release day, I’d suggest keeping r1648 for the moment and I’ll submit a patch after the release. Does that sound ok? Cheers Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd

[Podofo-users] Patch for PdfString underflow

2016-05-28 Thread Mark Rogers
ehaviour is bad (i.e. access faults or out of memory errors). Where the current behaviour is reasonable there are no changes other than documenting the behaviour. Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No

[Podofo-users] Patch for warning RC4011: identifier truncated to 'PODOFO_COMPILER_LACKS_LL_LITERA'

2016-05-05 Thread Mark Rogers
PODOFO_LL_LITERAL(x) x##LL # define PODOFO_ULL_LITERAL(x) x##ULL #endif #endif RC.exe doesn't define __FILE__ when compiling - all C/C++ compilers do (and PoDoFo already has dependencies on __FILE__ in PODOFO_RAISE_ERROR and AddToCallstack calls) Cheers Mark Mark Rogers - mark.rog...@powermapper.com

[Podofo-users] Underflows in PdfString::GetLength, PdfString::GetUnicodeLength, PdfString::GetCharacterLength

2016-05-07 Thread Mark Rogers
::GetCharacterLength() const { return this->IsUnicode() ? this->GetUnicodeLength() : this->GetLength(); } pdf_long PdfString::GetUnicodeLength() const { // patch? if ( m_buffer.GetSize() == 0 ) return 0; return (m_buffer.GetSize() / sizeof(pdf_utf16be)) - 1; } Best Regards Mark Ma

Re: [Podofo-users] Patch for warning RC4011: identifier truncated to 'PODOFO_COMPILER_LACKS_LL_LITERA'

2016-05-09 Thread Mark Rogers
very old compilers __FILE__ is guaranteed to be defined in C/C++ code by the C/C++ standard (first standardised in C89) __FILE__ is documented as undefined in the Windows Resource Compiler documentation PoDoFo C++ code won't compile if __FILE__ is undefined since it's used by PODOFO_RAISE_ERROR (a

Re: [Podofo-users] Patch for warning RC4011: identifier truncated to 'PODOFO_COMPILER_LACKS_LL_LITERA'

2016-05-09 Thread Mark Rogers
/podofo/PdfExtension.h is missing from SVN (running create_forward_headers.sh should fix this) Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL -Original Message- From

Re: [Podofo-users] PoDoFo 0.9.5.-rc1 Read for Download

2017-01-22 Thread Mark Rogers
ying an array or collection of PdfPainters means some destructors are never called Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL On 22/01/2017, 11:02, "zyx" &l

Re: [Podofo-users] PoDoFo 0.9.5 Release Plan

2017-01-16 Thread Mark Rogers
platforms. Eliminating this will reduce memory requirements by 28%, but requires bigger changes than just re-ordering members. I’ll look at that for next release. Cheers Mark -- Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274

Re: [Podofo-users] PoDoFo 0.9.5.-rc1 Read for Download

2017-01-19 Thread Mark Rogers
Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL On 17/01/2017, 08:17, "zyx" <z...@litepdf.cz> wrote: On Mon, 2017-01-16 at 20:25 +0100, Dominik Seichter wrote: >

Re: [Podofo-users] PdfName memory usage

2017-01-13 Thread Mark Rogers
ry key If the dictionary keys are changed to PdfName& or PdfName* then it changes to Total: 4 bytes per dictionary key (Sizeof(PdfName*) = sizeof(void*) = 4 bytes) with no heap overhead Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered i

Re: [Podofo-users] PoDoFo 0.9.5 Release Plan

2017-01-05 Thread Mark Rogers
the memory layout of member variables) but won’t affect source compatibility. Do you want me to submit the patches? Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL From

Re: [Podofo-users] another bunch of crashes

2017-03-30 Thread Mark Rogers
Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL On 19/03/2017, 18:51, "Mattia Rizzolo" <mat...@mapreri.org> wrote: On Mon, Mar 13, 2017 at 01:39:00PM +0100

[Podofo-users] Fix CVE-2017-7378: out-by-one buffer read scanning string

2017-04-19 Thread Mark Rogers
This fixes an out by one buffer read caused by string loop control using for( i=0;i<=lStringLen;i++ ) instead of for( i=0;i<lStringLen;i++ ) Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com<mailto:mark.rog...@powermapper.com> PowerMapper Software Ltd - www.pow

[Podofo-users] Fix CVE-2017-7379: encoding array too short to encode/decode code point 0xffff

2017-04-19 Thread Mark Rogers
Previously the encoding table for PdfSimpleEncoding contained 0x entries. This was one entry too short to encode code point 0x Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com<mailto:mark.rog...@powermapper.com> PowerMapper Software Ltd - www.powermapper.com Regi

Re: [Podofo-users] CVE fix proposal

2017-04-21 Thread Mark Rogers
The revised patch doesn’t compile because it uses: +PODOFO_ERROR_INFO( ePdfError_ValueOutOfRange, +"xref subsection's given entry numbers together too large" ); instead of +PODOFO_RAISE_ERROR_INFO ( ePdfError_ValueOutOfRange, +"xref

Re: [Podofo-users] another bunch of crashes

2017-04-07 Thread Mark Rogers
hes since the pObj == pObj->GetParent() case is probably the most common, but the depth check covers other types of loops in the “Parent” structure and protects against deeply nested PDFs Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.power

Re: [Podofo-users] CVE-2017-5853 and CVE-2017-6844 testing (overflow fixed, but unhandled exception present)

2018-04-14 Thread Mark Rogers
the new tests. Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL On 13/04/2018, 21:58, "Mattia Rizzolo" <mat...@mapreri.org> wrote: On Fri, Apr 1

[Podofo-users] CVE-2017-5853 and CVE-2017-6844 testing (overflow fixed, but unhandled exception present)

2018-04-13 Thread Mark Rogers
for 0.9.6 – but the fix would be making all the errors in ReadXRefSubSection all throw ePdfError_InvalidXRef or all throw ePdfError_InvalidXRef. If I can also submit the parser unit tests now, but I was planning to wait until 0.9.6 release was complete Cheers Mark -- Mark Rogers - mark.rog

[Podofo-users] CVE-2017-5855 and CVE-2017-6844

2018-04-15 Thread Mark Rogers
to std::vector::resize(count) Without ASAN enabled std::vector::resize with a large count will throw a std::bad_alloc and be caught by the catch( std::exception ) statement in ReadXRefSubsection Does this analysis make sense? Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com

[Podofo-users] [PATCH] PoFoFo: fix CVE-2018-5296 by reducing limit in s_nMaxObjects

2018-04-15 Thread Mark Rogers
Regards Mark -- Mark Rogers - mark.rog...@powermapper.com<mailto:mark.rog...@powermapper.com> PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL patch-CVE-2018-5296.diff Description: patch-CVE-2018-529

[Podofo-users] PDF CVE Security Research

2018-04-19 Thread Mark Rogers
support JPEG 2000 or XFA? Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com<mailto:mark.rog...@powermapper.com> PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh E

[Podofo-users] PdfParser unit tests

2018-04-19 Thread Mark Rogers
in canOutOfMemoryKillUnitTests() at end of ParserTests.cpp Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com<mailto:mark.rog...@powermapper.com> PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL ParserTest.h Description: Parser

[Podofo-users] PoDoFo PdfString::Write buffer overflow

2018-04-19 Thread Mark Rogers
//stackoverflow.com/a/3751937 memcpy([2], m_buffer.GetBuffer(), 2 - 2); Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com<mailto:mark.rog...@powermapper.com> PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quarte

[Podofo-users] PodoFo Unit Test patches

2019-04-25 Thread Mark Rogers
PODOFO_HAVE_OPENSSL is defined by rethrowing exception in methods that didn’t have try … catch previously. Patches tested on Windows / Mac without OpenSSL support. Not tested on Linux. Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com

Re: [Podofo-users] PoDoFo and recursive stack consumption CVEs

2021-11-13 Thread Mark Rogers
tickets/7/#df09 and the PdfParser unit tests https://sourceforge.net/p/podofo/mailman/message/36298123/ Cheers Mark -- Mark Rogers - mark.rog...@powermapper.com<mailto:mark.rog...@powermapper.com> PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermil

Re: [Podofo-users] PoDoFo and recursive stack consumption CVEs

2021-11-25 Thread Mark Rogers
797. This is caused by an invalid negative value for one of the FlateDecode compression parameters which results in a call to podofo_calloc( -14 ) == podofo_calloc( 0xfff2 ) Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com

Re: [Podofo-users] PoDoFo and recursive stack consumption CVEs

2021-11-22 Thread Mark Rogers
and looping PDF structures. We’ll submit these along with a patch - these tests make it easy to experiment with different patches for the same issue. Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274

Re: [Podofo-users] PoDoFo and recursive stack consumption CVEs

2021-11-22 Thread Mark Rogers
); --s_nRecursionDepth; // PoDoFo is multi threaded and this needs protected by a mutex #endif } Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL From: Christopher Creutzig Date

Re: [Podofo-users] PoDoFo and recursive stack consumption CVEs

2021-11-22 Thread Mark Rogers
s,. I think the standard says it’s a macro: https://en.cppreference.com/w/c/thread/thread_local Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL From: Christopher Creutzig Date

[Podofo-users] PoDoFo and recursive stack consumption CVEs

2021-10-27 Thread Mark Rogers
to a method just involves adding the following local variable to any method you need to guard: PdfRecursionGuard guard; Is option 3) worth investigating? What does everyone think? Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com<mailto:mark.rog...@powermapper.com> PowerMa

Re: [Podofo-users] PoDoFo and recursive stack consumption CVEs

2022-02-02 Thread Mark Rogers
). Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL From: Michal Sudolsky Date: Thursday, 25 November 2021 at 18:25 To: Christopher Creutzig Cc: "podofo-

Re: [Podofo-users] PoDoFo and recursive stack consumption CVEs

2022-02-02 Thread Mark Rogers
: ePdfError_InvalidXRef, /* The XRef table is invalid or recursion is too deep */ 1. Don’t think replacing ePdfError_InvalidXRef completely is option since that gets thrown invalid xrefs and recursion isn’t involved Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com

[Podofo-users] Patch for CVE-2018-20797

2022-04-11 Thread Mark Rogers
her so produce the wrong buffer size (e.g. if nColumns=1, m_nBPC=2 and m_nColors=SIZE_MAX/2+1). This has been tested in production for a few months on Mac 64-bit / Windows 32-bit. Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Regi

Re: [Podofo-users] Future ABI stability of PoDoFo

2022-05-10 Thread Mark Rogers
-work-defect-reports-and-clarifications It might be ok to use selected C++20 features, but how easy is it to identify which parts of the C++20 standard are stable and are available across the main compilers? Best Regards Mark -- Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd