[poppler] 2 commits - poppler/Array.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 31 07:12:11 UTC 2018


 poppler/Array.cc |    2 --
 1 file changed, 2 deletions(-)

New commits:
commit 3407c5c8003e67deba2b477741ac471927d40f14
Author: Adam Reichold <adam.reichold at t-online.de>
Date:   Fri Aug 31 07:38:34 2018 +0200

    Reintroduce the assertion in Array::remove since there it is not possible to check any return value.

diff --git a/poppler/Array.cc b/poppler/Array.cc
index ec99e5bc..f2dc2363 100644
--- a/poppler/Array.cc
+++ b/poppler/Array.cc
@@ -107,6 +107,7 @@ void Array::add(Object &&elem) {
 void Array::remove(int i) {
   arrayLocker();
   if (i < 0 || i >= length) {
+    assert(i >= 0 && i < length);
     return;
   }
   --length;
commit 2c25d197c921e292f49aa2b25f4006acd57c1440
Author: Adam Reichold <adam.reichold at t-online.de>
Date:   Thu Aug 30 20:26:55 2018 +0200

    Remove index out of range assertions from Array getters
    
    A lot of code seems to have been incompatible with the recently removed DEBUG_MEM
    flag, i.e. it relied on the Array getters returning a null object when the index
    was out of range and rather checked the returned object type (since they had to do
    that in any case) than the index.
    
    Due to this, debug builds became much harder to test, especially using fuzzing. This
    commit thereby removes the assertions to restore the situation when DEBUG_MEM was
    present but disabeld by default and should thereby fix oss-fuzz/10121.

diff --git a/poppler/Array.cc b/poppler/Array.cc
index 01a06568..ec99e5bc 100644
--- a/poppler/Array.cc
+++ b/poppler/Array.cc
@@ -107,7 +107,6 @@ void Array::add(Object &&elem) {
 void Array::remove(int i) {
   arrayLocker();
   if (i < 0 || i >= length) {
-    assert(i >= 0 && i < length);
     return;
   }
   --length;
@@ -116,7 +115,6 @@ void Array::remove(int i) {
 
 Object Array::get(int i, int recursion) const {
   if (i < 0 || i >= length) {
-    assert(i >= 0 && i < length);
     return Object(objNull);
   }
   return elems[i].fetch(xref, recursion);
@@ -124,7 +122,6 @@ Object Array::get(int i, int recursion) const {
 
 Object Array::getNF(int i) const {
   if (i < 0 || i >= length) {
-    assert(i >= 0 && i < length);
     return Object(objNull);
   }
   return elems[i].copy();


More information about the poppler mailing list