[Git][debian-gis-team/shapelib][master] 2 commits: Add upstream patch to fix CVE-2026-133217. (closes: #1155148)

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Tue Nov 24 19:43:31 GMT 2026



Bas Couwenberg pushed to branch master at Debian GIS Project / shapelib


Commits:
2fa065c4 by Bas Couwenberg at 2026-11-24T20:41:36+01:00
Add upstream patch to fix CVE-2026-133217. (closes: #1155148)

- - - - -
79687c94 by Bas Couwenberg at 2026-11-24T20:41:50+01:00
Set distribution to unstable.

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/CVE-2026-133217.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,8 +1,10 @@
-shapelib (1.6.3-2) UNRELEASED; urgency=medium
+shapelib (1.6.3-2) unstable; urgency=medium
 
   * Bump Standards-Version to 4.7.4, no changes.
+  * Add upstream patch to fix CVE-2026-133217.
+    (closes: #1155148)
 
- -- Bas Couwenberg <sebastic at debian.org>  Sat, 04 Apr 2026 10:22:59 +0200
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 24 Nov 2026 20:41:37 +0100
 
 shapelib (1.6.3-1) unstable; urgency=medium
 


=====================================
debian/patches/CVE-2026-133217.patch
=====================================
@@ -0,0 +1,59 @@
+DescriptioN: DBFCloneEmpty: check DBFOpen for NULL before dereference
+Author: Kulraj69 <59130414+Kulraj69 at users.noreply.github.com>
+Origin: https://github.com/OSGeo/shapelib/pull/197
+Bug: https://github.com/OSGeo/shapelib/issues/196
+
+--- a/dbfopen.c
++++ b/dbfopen.c
+@@ -1789,6 +1789,10 @@ DBFHandle SHPAPI_CALL DBFCloneEmpty(cons
+     DBFClose(newDBF);
+ 
+     newDBF = DBFOpen(pszFilename, "rb+");
++    if (newDBF == SHPLIB_NULLPTR)
++    {
++        return SHPLIB_NULLPTR;
++    }
+     newDBF->bWriteEndOfFileChar = psDBF->bWriteEndOfFileChar;
+ 
+     return (newDBF);
+--- a/tests/dbf_test.cc
++++ b/tests/dbf_test.cc
+@@ -122,6 +122,38 @@ TEST(DBFCreateTest, CloneEmpty)
+     fs::remove(filename);
+ }
+ 
++TEST(DBFCreateTest, CloneEmptyReopenFails)
++{
++    // A .dbf whose header length claims two field descriptors, but whose
++    // second descriptor is the 0x0D header terminator.  DBFOpen() accepts it
++    // with one field.  DBFCloneEmpty() copies the original header length but
++    // writes only one field descriptor, so the re-open of the clone fails.
++    // https://github.com/OSGeo/shapelib/issues/196
++    std::string content(97, '\0');
++    content[0] = 0x03;       // dBASE III
++    content[8] = 97;         // Header length: 32 + 2 * 32 + 1
++    content[10] = 6;         // Record length
++    content[32] = 'A';       // Field name
++    content[32 + 11] = 'C';  // Field type
++    content[32 + 16] = 5;    // Field width
++    content[64] = 0x0D;      // Header terminator in place of field 2
++    content[96] = 0x0D;
++    const auto srcname =
++        fs::temp_directory_path() / GenerateUniqueFilename(".clone-src.dbf");
++    ASSERT_TRUE(SetContents(srcname, content));
++    const auto clonename =
++        fs::temp_directory_path() / GenerateUniqueFilename(".clone-dst.dbf");
++    const auto handle = DBFOpen(srcname.string().c_str(), "rb");
++    ASSERT_NE(nullptr, handle);
++    EXPECT_EQ(1, DBFGetFieldCount(handle));
++    const auto clonedhandle = DBFCloneEmpty(handle, clonename.string().c_str());
++    EXPECT_EQ(nullptr, clonedhandle);
++    DBFClose(clonedhandle);
++    DBFClose(handle);
++    fs::remove(srcname);
++    fs::remove(clonename);
++}
++
+ static auto WriteDate(const fs::path &filename,
+                       const std::unique_ptr<const SHPDate> &date) -> auto
+ {


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+CVE-2026-133217.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/shapelib/-/compare/351d3b6db30c9262a847ed202a6d36d5f9d4678a...79687c9470f3448fe84f4108f9678e87b6ef5dd9

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/shapelib/-/compare/351d3b6db30c9262a847ed202a6d36d5f9d4678a...79687c9470f3448fe84f4108f9678e87b6ef5dd9
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20261124/ba2b7ab3/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list