[geos-commits] [SCM] GEOS branch svn-3.6 updated. b0bff6d07e559833ea5521e9a98216a558611e71

git at osgeo.org git at osgeo.org
Tue Aug 27 08:59:16 PDT 2019


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, svn-3.6 has been updated
       via  b0bff6d07e559833ea5521e9a98216a558611e71 (commit)
      from  4a33d8a7bcdc48e4ba29359499e5f1a4ca172e84 (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 b0bff6d07e559833ea5521e9a98216a558611e71
Author: Daniel Baston <dbaston at gmail.com>
Date:   Tue Aug 27 11:56:51 2019 -0400

    Avoid segfault when querying empty tree
    
    Fixes #730

diff --git a/NEWS b/NEWS
index 07b0462..e73767e 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Changes in 3.6.4
   - Polygon build failure in Overlay difference (#789 Paul Ramsey)
   - Invalid union result from valid polygon inputs (#838)
   - Static library does not contain C API (#878)
+  - Prevent crash when querying empty STRtree (#730)
 
 
 Changes in 3.6.3
diff --git a/src/index/strtree/AbstractSTRtree.cpp b/src/index/strtree/AbstractSTRtree.cpp
index 84e7a86..c6ba878 100644
--- a/src/index/strtree/AbstractSTRtree.cpp
+++ b/src/index/strtree/AbstractSTRtree.cpp
@@ -125,7 +125,10 @@ AbstractSTRtree::query(const void* searchBounds, vector<void*>& matches)
 {
 	if (!built) build();
 
-	if (itemBoundables->empty()) assert(root->getBounds()==NULL);
+	if (itemBoundables->empty()) {
+		assert(root->getBounds()==NULL);
+		return;
+	}
 
 	if (getIntersectsOp()->intersects(root->getBounds(), searchBounds))
 	{
@@ -139,8 +142,11 @@ AbstractSTRtree::query(const void* searchBounds, ItemVisitor& visitor)
 {
 	if (!built) build();
 
-	if (itemBoundables->empty()) assert(root->getBounds()==NULL);
-	
+	if (itemBoundables->empty()) {
+        assert(root->getBounds()==NULL);
+        return;
+	}
+
 	if (getIntersectsOp()->intersects(root->getBounds(),searchBounds))
 	{
 		query(searchBounds, *root, visitor);

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

Summary of changes:
 NEWS                                  |  1 +
 src/index/strtree/AbstractSTRtree.cpp | 12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list