Check for duplicate entries
authorKevin Backhouse <kevinbackhouse@github.com>
Wed, 3 Sep 2025 13:36:54 +0000 (14:36 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 12 Oct 2025 18:30:50 +0000 (20:30 +0200)
Origin: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4ce27cc826bf90cc8dbbd8a8c87bd913cccd7ec0
Bug-Debian: https://bugs.debian.org/1117853
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2025-52885

Gbp-Pq: Name Check-for-duplicate-entries.patch

poppler/StructTreeRoot.cc

index 99ddbfe548c6ca0b7702f66d8cd1ba73ace33a39..f7a2794326fdcdf681ac12e0b94f88b69aafa838 100644 (file)
@@ -137,6 +137,10 @@ void StructTreeRoot::parseNumberTreeNode(Dict *node)
                 }
                 int keyVal = key.getInt();
                 std::vector<Parent> &vec = parentTree[keyVal];
+                if (!vec.empty()) {
+                    error(errSyntaxError, -1, "Nums item at position {0:d} is a duplicate entry for key {1:d}", i, keyVal);
+                    continue;
+                }
 
                 Object valueArray = nums.arrayGet(i + 1);
                 if (valueArray.isArray()) {