[geos-commits] [SCM] GEOS branch 3.12 updated. 3d1d86b43f25c60400e491de64d7579b534747a3

git at osgeo.org git at osgeo.org
Fri Oct 3 13:13:32 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, 3.12 has been updated
       via  3d1d86b43f25c60400e491de64d7579b534747a3 (commit)
      from  5b6bd8e5483ea23937b6bded95899166b79c3b75 (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 3d1d86b43f25c60400e491de64d7579b534747a3
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 fc36b4bb3..856e0fc33 100644
--- a/src/geom/CoordinateSequence.cpp
+++ b/src/geom/CoordinateSequence.cpp
@@ -256,9 +256,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