File 0022-Correct-boundary-comparison-in-PdfListField::GetItemDisplayText.patch of Package podofo

Subject: Fix by Michal Sudolsky: Correct boundary comparison in PdfListField::GetItemDisplayText()
Url: https://sourceforge.net/p/podofo/code/1863/

--- a/podofo/trunk/src/doc/PdfField.cpp
+++ b/podofo/trunk/src/doc/PdfField.cpp
@@ -891,7 +891,7 @@
     if( m_pObject->GetDictionary().HasKey( PdfName("Opt") ) )
         opt = m_pObject->GetDictionary().GetKey( PdfName("Opt") )->GetArray();
     
-    if( nIndex < 0 || nIndex > static_cast<int>(opt.size()) )
+    if( nIndex < 0 || nIndex >= static_cast<int>(opt.size()) )
     {
         PODOFO_RAISE_ERROR( ePdfError_ValueOutOfRange );
     }
openSUSE Build Service is sponsored by