download.lst                                                 |    4 
 external/poppler/UnpackedTarball_poppler.mk                  |    1 
 external/poppler/poppler-0.46.0-unused-private-field.patch.1 |   11 
 external/poppler/ubsan.patch.0                               |  229 ++++++++++-
 4 files changed, 220 insertions(+), 25 deletions(-)

New commits:
commit 7f51b445b4dd3950527d826c01091be4e9a77be0
Author: David Tardon <dtar...@redhat.com>
Date:   Sat Oct 22 10:16:56 2016 +0200

    upload poppler 0.48.0
    
    Change-Id: I18c49505f71ab609e5cc0e4db759152c3c1d5825
    (cherry picked from commit dc522a114d24ad7c550c072d4f29f50a62260b77)
    Reviewed-on: https://gerrit.libreoffice.org/56252
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/download.lst b/download.lst
index 42ed25265e27..958ed3048252 100644
--- a/download.lst
+++ b/download.lst
@@ -129,8 +129,8 @@ export PAGEMAKER_TARBALL := libpagemaker-0.0.3.tar.bz2
 export PIXMAN_TARBALL := c63f411b3ad147db2bcce1bf262a0e02-pixman-0.24.4.tar.bz2
 export PNG_MD5SUM := 897ccec1ebfb0922e83c2bfaa1be8748
 export PNG_TARBALL := libpng-1.6.28.tar.gz
-export POPPLER_MD5SUM := 38c758d84437378ec4f5aae9f875301d
-export POPPLER_TARBALL := poppler-0.46.0.tar.bz2
+export POPPLER_MD5SUM := 8d61c91cb9e99ad38bba1b0b4432f174
+export POPPLER_TARBALL := poppler-0.48.0.tar.xz
 export POSTGRESQL_TARBALL := 
c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
 
 ifeq ($(PYTHON_VERSION_MINOR),3)
diff --git a/external/poppler/UnpackedTarball_poppler.mk 
b/external/poppler/UnpackedTarball_poppler.mk
index efcbee7c7e0f..afad5fba13b6 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -17,7 +17,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
        external/poppler/poppler-mac-fake.patch.1 \
        external/poppler/poppler-vs2013.patch.1 \
        external/poppler/poppler-0.46.0-std-max.patch.1 \
-       external/poppler/poppler-0.46.0-unused-private-field.patch.1 \
        external/poppler/ubsan.patch.0 \
        external/poppler/poppler-libjpeg.patch.1 \
 ))
diff --git a/external/poppler/poppler-0.46.0-unused-private-field.patch.1 
b/external/poppler/poppler-0.46.0-unused-private-field.patch.1
deleted file mode 100644
index e0765fc92251..000000000000
--- a/external/poppler/poppler-0.46.0-unused-private-field.patch.1
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/goo/GooString.h
-+++ b/goo/GooString.h
-@@ -175,7 +175,7 @@
-   // You can tweak the final object size for different time/space tradeoffs.
-   // In libc malloc(), rounding is 16 so it's best to choose a value that
-   // is a multiple of 16.
--  class MemoryLayout {
-+  struct MemoryLayout {
-       char c[sizeof(char*)];
-       int i;
-       char* s;
diff --git a/external/poppler/ubsan.patch.0 b/external/poppler/ubsan.patch.0
index a27f00f790d2..575cb47dc682 100644
--- a/external/poppler/ubsan.patch.0
+++ b/external/poppler/ubsan.patch.0
@@ -1,14 +1,3 @@
---- goo/GooString.cc
-+++ goo/GooString.cc
-@@ -161,7 +161,7 @@
-       // assert(s != s1) the roundedSize condition ensures this
-       if (newLength < length) {
-       memcpy(s1, s, newLength);
--      } else {
-+      } else if (length != 0) {
-       memcpy(s1, s, length);
-       }
-       if (s != sStatic)
 --- poppler/Form.cc
 +++ poppler/Form.cc
 @@ -463,12 +463,11 @@
commit 3c181843cb878f4ac5a563e0ceff582d46763a45
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Fri Oct 14 15:34:53 2016 +0200

    external/poppler: Avoid UBSan warning about undefined downcast
    
    ...of this-ptr of in-construction FormFieldSignature while still in the base
    FormField ctor, as happens (in the xpdfimport process) during
    CppunitTest_xmlsecurity_signing:
    
    > Form.cc:448:12: runtime error: downcast of address 0x60f000000040 which 
does not point to an object of type 'FormFieldSignature'
    > 0x60f000000040: note: object is of type 'FormField'
    >  03 00 00 6d  50 84 f2 00 00 00 00 00  03 00 00 00 04 00 00 00  00 00 00 
00 01 be be be  07 00 00 00
    >               ^~~~~~~~~~~~~~~~~~~~~~~
    >               vptr for 'FormField'
    >     #0 0x73d7f4 in FormWidgetSignature::FormWidgetSignature(PDFDoc*, 
Object*, unsigned int, Ref, FormField*) 
workdir/UnpackedTarball/poppler/poppler/Form.cc:448:12
    >     #1 0x741713 in FormField::_createWidget(Object*, Ref) 
workdir/UnpackedTarball/poppler/poppler/Form.cc:677:34
    >     #2 0x73e747 in FormField::FormField(PDFDoc*, Object*, Ref const&, 
FormField*, std::set<int, std::less<int>, std::allocator<int> >*, 
FormFieldType) workdir/UnpackedTarball/poppler/poppler/Form.cc:547:7
    >     #3 0x74ec2b in FormFieldSignature::FormFieldSignature(PDFDoc*, 
Object*, Ref const&, FormField*, std::set<int, std::less<int>, 
std::allocator<int> >*) workdir/UnpackedTarball/poppler/poppler/Form.cc:1383:5
    >     #4 0x740d7f in Form::createFieldFromDict(Object*, PDFDoc*, Ref 
const&, FormField*, std::set<int, std::less<int>, std::allocator<int> >*) 
workdir/UnpackedTarball/poppler/poppler/Form.cc:1700:19
    >     #5 0x750727 in Form::Form(PDFDoc*, Object*) 
workdir/UnpackedTarball/poppler/poppler/Form.cc:1623:33
    >     #6 0x71d440 in Catalog::getForm() 
workdir/UnpackedTarball/poppler/poppler/Catalog.cc:1042:18
    >     #7 0x708572 in Annots::createAnnot(Dict*, Object*) 
workdir/UnpackedTarball/poppler/poppler/Annot.cc:7218:41
    >     #8 0x70772b in Annots::Annots(PDFDoc*, int, Object*) 
workdir/UnpackedTarball/poppler/poppler/Annot.cc:7128:17
    >     #9 0x87f3e9 in Page::getAnnots(XRef*) 
workdir/UnpackedTarball/poppler/poppler/Page.cc:405:18
    >     #10 0x8814b0 in Page::displaySlice(OutputDev*, double, double, int, 
bool, bool, int, int, int, int, bool, bool (*)(void*), void*, bool (*)(Annot*, 
void*), void*, bool) workdir/UnpackedTarball/poppler/poppler/Page.cc:611:15
    >     #11 0x880ff6 in Page::display(OutputDev*, double, double, int, bool, 
bool, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, bool) 
workdir/UnpackedTarball/poppler/poppler/Page.cc:521:3
    >     #12 0x88d906 in PDFDoc::displayPage(OutputDev*, int, double, double, 
int, bool, bool, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, 
bool) workdir/UnpackedTarball/poppler/poppler/PDFDoc.cc:491:20
    >     #13 0x5d59fb in main 
sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:142:14
    >     #14 0x7f11600ea730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    >     #15 0x459388 in _start (instdir/program/xpdfimport+0x459388)
    
    Change-Id: Ia808919c8d2363d616feb4664f314a77b40dfbb8
    (cherry picked from commit 55013a7776a43bb18b7fb8faa1839369c3383cb7)
    Reviewed-on: https://gerrit.libreoffice.org/56251
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/external/poppler/ubsan.patch.0 b/external/poppler/ubsan.patch.0
index 623858da9f1f..a27f00f790d2 100644
--- a/external/poppler/ubsan.patch.0
+++ b/external/poppler/ubsan.patch.0
@@ -9,6 +9,224 @@
        memcpy(s1, s, length);
        }
        if (s != sStatic)
+--- poppler/Form.cc
++++ poppler/Form.cc
+@@ -463,12 +463,11 @@
+ // FormField
+ //========================================================================
+ 
+-FormField::FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField 
*parentA, std::set<int> *usedParents, FormFieldType ty)
++FormField::FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField 
*parentA, FormFieldType ty)
+ {
+   doc = docA;
+   xref = doc->getXRef();
+   aobj->copy(&obj);
+-  Dict* dict = obj.getDict();
+   ref.num = ref.gen = 0;
+   type = ty;
+   parent = parentA;
+@@ -483,7 +482,11 @@
+   hasQuadding = gFalse;
+ 
+   ref = aref;
++}
+ 
++void FormField::init(std::set<int> *usedParents)
++{
++  Dict* dict = obj.getDict();
+   Object obj1;
+   //childs
+   if (dict->lookup("Kids", &obj1)->isArray()) {
+@@ -803,9 +806,15 @@
+ //------------------------------------------------------------------------
+ // FormFieldButton
+ //------------------------------------------------------------------------
+-FormFieldButton::FormFieldButton(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
+-  : FormField(docA, aobj, ref, parent, usedParents, formButton)
++FormFieldButton::FormFieldButton(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent)
++  : FormField(docA, aobj, ref, parent, formButton)
+ {
++}
++
++void FormFieldButton::init(std::set<int> *usedParents)
++{
++  FormField::init(usedParents);
++
+   Dict* dict = obj.getDict();
+   active_child = -1;
+   noAllOff = false;
+@@ -983,9 +992,15 @@
+ //------------------------------------------------------------------------
+ // FormFieldText
+ //------------------------------------------------------------------------
+-FormFieldText::FormFieldText(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
+-  : FormField(docA, aobj, ref, parent, usedParents, formText)
++FormFieldText::FormFieldText(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent)
++  : FormField(docA, aobj, ref, parent, formText)
+ {
++}
++
++void FormFieldText::init(std::set<int> *usedParents)
++{
++  FormField::init(usedParents);
++
+   Dict* dict = obj.getDict();
+   Object obj1;
+   content = NULL;
+@@ -1076,9 +1091,15 @@
+ //------------------------------------------------------------------------
+ // FormFieldChoice
+ //------------------------------------------------------------------------
+-FormFieldChoice::FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
+-  : FormField(docA, aobj, ref, parent, usedParents, formChoice)
++FormFieldChoice::FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent)
++  : FormField(docA, aobj, ref, parent, formChoice)
+ {
++}
++
++void FormFieldChoice::init(std::set<int> *usedParents)
++{
++  FormField::init(usedParents);
++
+   numChoices = 0;
+   choices = NULL;
+   editedChoice = NULL;
+@@ -1379,9 +1400,15 @@
+ //------------------------------------------------------------------------
+ // FormFieldSignature
+ //------------------------------------------------------------------------
+-FormFieldSignature::FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& 
ref, FormField *parent, std::set<int> *usedParents)
+-  : FormField(docA, dict, ref, parent, usedParents, formSignature)
++FormFieldSignature::FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& 
ref, FormField *parent)
++  : FormField(docA, dict, ref, parent, formSignature)
+ {
++}
++
++void FormFieldSignature::init(std::set<int> *usedParents)
++{
++  FormField::init(usedParents);
++
+   signature = NULL;
+ 
+   signature_info = new SignatureInfo();
+@@ -1691,15 +1718,15 @@
+     FormField *field;
+ 
+     if (Form::fieldLookup(obj->getDict (), "FT", &obj2)->isName("Btn")) {
+-      field = new FormFieldButton(docA, obj, pref, parent, usedParents);
++      field = FormFieldButton::create(docA, obj, pref, parent, usedParents);
+     } else if (obj2.isName("Tx")) {
+-      field = new FormFieldText(docA, obj, pref, parent, usedParents);
++      field = FormFieldText::create(docA, obj, pref, parent, usedParents);
+     } else if (obj2.isName("Ch")) {
+-      field = new FormFieldChoice(docA, obj, pref, parent, usedParents);
++      field = FormFieldChoice::create(docA, obj, pref, parent, usedParents);
+     } else if (obj2.isName("Sig")) {
+-      field = new FormFieldSignature(docA, obj, pref, parent, usedParents);
++      field = FormFieldSignature::create(docA, obj, pref, parent, 
usedParents);
+     } else { //we don't have an FT entry => non-terminal field
+-      field = new FormField(docA, obj, pref, parent, usedParents);
++      field = FormField::create(docA, obj, pref, parent, usedParents);
+     }
+     obj2.free();
+ 
+--- poppler/Form.h
++++ poppler/Form.h
+@@ -264,8 +264,16 @@
+ //------------------------------------------------------------------------
+ 
+ class FormField {
+-public:
+-  FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField *parent, 
std::set<int> *usedParents, FormFieldType t=formUndef);
++protected:
++  FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField *parent, 
FormFieldType t);
++  void init(std::set<int> *usedParents);
++public:
++  static FormField *create(PDFDoc *docA, Object *aobj, const Ref& aref, 
FormField *parent, std::set<int> *usedParents, FormFieldType t=formUndef)
++  {
++    FormField *f = new FormField(docA, aobj, aref, parent, t);
++    f->init(usedParents);
++    return f;
++  }
+ 
+   virtual ~FormField();
+ 
+@@ -338,8 +346,16 @@
+ //------------------------------------------------------------------------
+ 
+ class FormFieldButton: public FormField {
+-public:
+-  FormFieldButton(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
++private:
++  FormFieldButton(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent);
++  void init(std::set<int> *usedParents);
++public:
++  static FormFieldButton *create(PDFDoc *docA, Object *dict, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
++  {
++    FormFieldButton *f = new FormFieldButton(docA, dict, ref, parent);
++    f->init(usedParents);
++    return f;
++  }
+ 
+   FormButtonType getButtonType () { return btype; }
+ 
+@@ -384,8 +400,16 @@
+ //------------------------------------------------------------------------
+ 
+ class FormFieldText: public FormField {
+-public:
+-  FormFieldText(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
++private:
++  FormFieldText(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent);
++  void init(std::set<int> *usedParents);
++public:
++  static FormFieldText *create(PDFDoc *docA, Object *dict, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
++  {
++    FormFieldText *f = new FormFieldText(docA, dict, ref, parent);
++    f->init(usedParents);
++    return f;
++  }
+   
+   GooString* getContent () { return content; }
+   GooString* getContentCopy ();
+@@ -422,8 +446,16 @@
+ //------------------------------------------------------------------------
+ 
+ class FormFieldChoice: public FormField {
+-public:
+-  FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
++private:
++  FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, FormField 
*parent);
++  void init(std::set<int> *usedParents);
++public:
++  static FormFieldChoice *create(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
++  {
++    FormFieldChoice *f = new FormFieldChoice(docA, aobj, ref, parent);
++    f->init(usedParents);
++    return f;
++  }
+ 
+   virtual ~FormFieldChoice();
+ 
+@@ -491,8 +523,16 @@
+ //------------------------------------------------------------------------
+ 
+ class FormFieldSignature: public FormField {
+-public:
+-  FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
++private:
++  FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent);
++  void init(std::set<int> *usedParents);
++public:
++  static FormFieldSignature *create(PDFDoc *docA, Object *dict, const Ref& 
ref, FormField *parent, std::set<int> *usedParents)
++  {
++    FormFieldSignature *f = new FormFieldSignature(docA, dict, ref, parent);
++    f->init(usedParents);
++    return f;
++  }
+ 
+   SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation);
+ 
 --- poppler/Stream.cc
 +++ poppler/Stream.cc
 @@ -2966,12 +2966,12 @@
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to