[geos-commits] [SCM] GEOS branch main updated. 883f237d1ecbf49f8efd09905df05814783c5b50

git at osgeo.org git at osgeo.org
Fri Oct 3 10:32:44 PDT 2025


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, main has been updated
       via  883f237d1ecbf49f8efd09905df05814783c5b50 (commit)
      from  db9a00da18c3ac6451a4d8bce3195fc8ab06d54f (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 883f237d1ecbf49f8efd09905df05814783c5b50
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Oct 3 10:06:16 2025 -0700

    Remove undefined behaviour in CoordinateSequence::closeRing. Closes #1309

diff --git a/src/geom/CoordinateSequence.cpp b/src/geom/CoordinateSequence.cpp
index 99af270f7..1292c2bd1 100644
--- a/src/geom/CoordinateSequence.cpp
+++ b/src/geom/CoordinateSequence.cpp
@@ -261,9 +261,10 @@ void
 CoordinateSequence::closeRing(bool allowRepeated)
 {
     if(!isEmpty() && (allowRepeated || front<CoordinateXY>() != back<CoordinateXY>())) {
-        m_vect.insert(m_vect.end(),
-                      m_vect.begin(),
-                      std::next(m_vect.begin(), stride()));
+        const std::size_t n = stride();
+        const std::size_t old = m_vect.size();
+        m_vect.resize(old + n);
+        std::copy_n(m_vect.data(), n, m_vect.data() + old);
     }
 }
 

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

Summary of changes:
 src/geom/CoordinateSequence.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list