[geos-commits] [SCM] GEOS branch 3.14 updated. 86ba6f9aa0d694ce87637ab5ecd264c304074606
    git at osgeo.org 
    git at osgeo.org
       
    Fri Oct  3 13:13:37 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.14 has been updated
       via  86ba6f9aa0d694ce87637ab5ecd264c304074606 (commit)
      from  115d442fd496235716583263727bf069a77efb43 (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 86ba6f9aa0d694ce87637ab5ecd264c304074606
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