[poppler] cpp/poppler-page.cpp

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Nov 28 00:13:46 UTC 2020


 cpp/poppler-page.cpp |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit de8abb8dd3fde0c0b3003ca460902b1517c32b4c
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Nov 28 01:06:37 2020 +0100

    cpp: page::search: Fix invalid memory access if searching for the empty string

diff --git a/cpp/poppler-page.cpp b/cpp/poppler-page.cpp
index 53d6ed56..5d02d5bb 100644
--- a/cpp/poppler-page.cpp
+++ b/cpp/poppler-page.cpp
@@ -211,6 +211,11 @@ page_transition *page::transition() const
 bool page::search(const ustring &text, rectf &r, search_direction_enum direction, case_sensitivity_enum case_sensitivity, rotation_enum rotation) const
 {
     const size_t len = text.length();
+
+    if (len == 0) {
+        return false;
+    }
+
     std::vector<Unicode> u(len);
     for (size_t i = 0; i < len; ++i) {
         u[i] = text[i];


More information about the poppler mailing list