[geos-commits] [SCM] GEOS branch 3.12 updated. 6b78a22051785b906aec03ce44933cbbc7846a50

git at osgeo.org git at osgeo.org
Thu Oct 24 13:43:18 PDT 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, 3.12 has been updated
       via  6b78a22051785b906aec03ce44933cbbc7846a50 (commit)
       via  214da3986d3770b8510b03ccb32c9831be94bd53 (commit)
      from  548448f19b7afa188699cb555904b6789114b536 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6b78a22051785b906aec03ce44933cbbc7846a50
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Oct 24 13:42:55 2024 -0700

    News item for GH-1077

diff --git a/NEWS.md b/NEWS.md
index 7bfe6a9c9..ec581d638 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -10,6 +10,7 @@
   - Fix ConcaveHullOfPolygons nested shell handling (GH-1169, Martin Davis)
   - GEOSConcaveHullOfPolygons, avoid crash on zero-area input (GH-1071, Dan Baston)
   - DouglasPeuckerLineSimplifier, avoid crash with Point input and NaN tolerance (GH-1078, Dan Baston)
+  - GEOSLineSubstring, avoid crash with NaN length fraction (GH-1077, Dan Baston)
 
 ## Changes in 3.12.2
 2024-06-05

commit 214da3986d3770b8510b03ccb32c9831be94bd53
Author: Daniel Baston <dbaston at gmail.com>
Date:   Wed May 15 09:01:06 2024 -0400

    GEOSLineSubstring: Avoid crash with NaN length fraction (#1088)
    
    * GEOSLineSubstring: Avoid crash with NaN length fraction
    
    Fixes https://github.com/libgeos/geos/issues/1077
    
    * GEOSLineSubstring: Add test for non-linear input

diff --git a/tests/unit/capi/GEOSLineSubstringTest.cpp b/tests/unit/capi/GEOSLineSubstringTest.cpp
index 0b9ffaf09..3345e234d 100644
--- a/tests/unit/capi/GEOSLineSubstringTest.cpp
+++ b/tests/unit/capi/GEOSLineSubstringTest.cpp
@@ -135,5 +135,31 @@ void object::test<8>
     ensure(result_ == nullptr);
 }
 
+// NaN start fraction
+// https://github.com/libgeos/geos/issues/1077
+template<>
+template<>
+void object::test<8>
+()
+{
+    input_ = fromWKT("LINESTRING EMPTY");
+    double start = std::numeric_limits<double>::quiet_NaN();
+    double end = 0.1;
+    result_ = GEOSLineSubstring(input_, start, end);
+
+    ensure(result_ == nullptr);
+}
+
+template<>
+template<>
+void object::test<9>
+()
+{
+    input_ = fromWKT("POLYGON ((0 0, 1 0, 1 1, 0 0))");
+    result_ = GEOSLineSubstring(input_, 0.2, 0.3);
+
+    ensure(result_ == nullptr);
+}
+
 } // namespace tut
 

-----------------------------------------------------------------------

Summary of changes:
 NEWS.md                                   |  1 +
 tests/unit/capi/GEOSLineSubstringTest.cpp | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list