[geos-commits] [SCM] GEOS branch main updated. 2c89410f5c6aef61a3f0d72a29c1f88cfb3573a4
git at osgeo.org
git at osgeo.org
Wed Jun 24 09:06:10 PDT 2026
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 2c89410f5c6aef61a3f0d72a29c1f88cfb3573a4 (commit)
from 278f015fbd3e9d48af5670d86e1681035a0f32ce (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 2c89410f5c6aef61a3f0d72a29c1f88cfb3573a4
Author: Arthur Chan <arthur.chan at adalogics.com>
Date: Wed Jun 24 17:05:51 2026 +0100
OSS-Fuzz: Add new fuzzer targets geo operations (#1455)
Signed-off-by: Arthur Chan <arthur.chan at adalogics.com>
diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt
index e96ac876f..3bc11057d 100644
--- a/tests/fuzz/CMakeLists.txt
+++ b/tests/fuzz/CMakeLists.txt
@@ -17,4 +17,8 @@ if(DEFINED ENV{LIB_FUZZING_ENGINE})
add_executable(fuzz_geojson fuzz_geojson.c)
target_include_directories(fuzz_geojson PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)
target_link_libraries(fuzz_geojson geos_c $ENV{LIB_FUZZING_ENGINE})
+
+ add_executable(fuzz_geo_ops fuzz_geo_ops.c)
+ target_include_directories(fuzz_geo_ops PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)
+ target_link_libraries(fuzz_geo_ops geos_c $ENV{LIB_FUZZING_ENGINE})
endif()
diff --git a/tests/fuzz/fuzz_geo_ops.c b/tests/fuzz/fuzz_geo_ops.c
new file mode 100644
index 000000000..06001363f
--- /dev/null
+++ b/tests/fuzz/fuzz_geo_ops.c
@@ -0,0 +1,129 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "geos_c.h"
+
+static int initialized = 0;
+FILE * flogOut;
+
+void
+notice(const char *fmt, ...) {
+ va_list ap;
+ fprintf( flogOut, "NOTICE: ");
+ va_start (ap, fmt);
+ vfprintf( flogOut, fmt, ap);
+ va_end(ap);
+ fprintf( flogOut, "\n" );
+}
+
+void
+log_and_exit(const char *fmt, ...) {
+ va_list ap;
+ fprintf( flogOut, "ERROR: ");
+ va_start (ap, fmt);
+ vfprintf( flogOut, fmt, ap);
+ va_end(ap);
+ fprintf( flogOut, "\n" );
+}
+
+int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+ if (initialized == 0) {
+ flogOut = fopen("/dev/null", "wb");
+ initGEOS(notice, log_and_exit);
+ initialized = 1;
+ }
+ if (Size < 2) {
+ return 0;
+ }
+
+ uint8_t sel = Data[0];
+ const uint8_t *body = Data + 1;
+ size_t blen = Size - 1;
+
+ GEOSGeometry *g;
+ if (sel & 1) {
+ g = GEOSGeomFromWKB_buf(body, blen);
+ } else {
+ char *wkt = (char *) malloc(blen + 1);
+ if (wkt == NULL) {
+ return 0;
+ }
+ memcpy(wkt, body, blen);
+ wkt[blen] = '\0';
+ g = GEOSGeomFromWKT(wkt);
+ free(wkt);
+ }
+ if (g == NULL) {
+ return 0;
+ }
+
+ double width = ((double) Data[1] - 128.0) / 16.0;
+ double tol = (double) (sel >> 1) / 8.0;
+ double range = (double) blen;
+
+ GEOSGeometry *r;
+
+ r = GEOSBuffer(g, width, (sel & 7) + 1);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSBufferWithStyle(g, width, (sel & 7) + 1,
+ (sel % 3) + 1, (sel % 3) + 1, 2.0 + tol);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSOffsetCurve(g, width, (sel & 7) + 1, (sel % 3) + 1, 2.0 + tol);
+ if (r) GEOSGeom_destroy(r);
+
+ r = GEOSConvexHull(g);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSConcaveHull(g, tol > 1.0 ? 1.0 : tol, sel & 2);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSMinimumRotatedRectangle(g);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSMinimumWidth(g);
+ if (r) GEOSGeom_destroy(r);
+
+ r = GEOSSimplify(g, tol);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSTopologyPreserveSimplify(g, tol);
+ if (r) GEOSGeom_destroy(r);
+
+ r = GEOSDelaunayTriangulation(g, tol, sel & 1);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSVoronoiDiagram(g, NULL, tol, sel & 1);
+ if (r) GEOSGeom_destroy(r);
+
+ r = GEOSMakeValid(g);
+ if (r) GEOSGeom_destroy(r);
+
+ r = GEOSUnaryUnion(g);
+ if (r) GEOSGeom_destroy(r);
+
+ r = GEOSClipByRect(g, -range, -range, range, range);
+ if (r) GEOSGeom_destroy(r);
+
+ r = GEOSNode(g);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSBoundary(g);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSGetCentroid(g);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSPointOnSurface(g);
+ if (r) GEOSGeom_destroy(r);
+ r = GEOSReverse(g);
+ if (r) GEOSGeom_destroy(r);
+
+ double d;
+ GEOSDistance(g, g, &d);
+ GEOSCoordSequence *seq = GEOSNearestPoints(g, g);
+ if (seq) GEOSCoordSeq_destroy(seq);
+
+ double a, l, c;
+ GEOSArea(g, &a);
+ GEOSLength(g, &l);
+ GEOSMinimumClearance(g, &c);
+ GEOSisValid(g);
+
+ GEOSGeom_destroy(g);
+ return 0;
+}
diff --git a/tests/fuzz/fuzz_geo_ops_seed_corpus/bowtie b/tests/fuzz/fuzz_geo_ops_seed_corpus/bowtie
new file mode 100644
index 000000000..189e206d5
Binary files /dev/null and b/tests/fuzz/fuzz_geo_ops_seed_corpus/bowtie differ
diff --git a/tests/fuzz/fuzz_geo_ops_seed_corpus/geomcoll b/tests/fuzz/fuzz_geo_ops_seed_corpus/geomcoll
new file mode 100644
index 000000000..95323a852
Binary files /dev/null and b/tests/fuzz/fuzz_geo_ops_seed_corpus/geomcoll differ
diff --git a/tests/fuzz/fuzz_geo_ops_seed_corpus/linestring b/tests/fuzz/fuzz_geo_ops_seed_corpus/linestring
new file mode 100644
index 000000000..241423d95
Binary files /dev/null and b/tests/fuzz/fuzz_geo_ops_seed_corpus/linestring differ
diff --git a/tests/fuzz/fuzz_geo_ops_seed_corpus/multiline b/tests/fuzz/fuzz_geo_ops_seed_corpus/multiline
new file mode 100644
index 000000000..dfc976c05
Binary files /dev/null and b/tests/fuzz/fuzz_geo_ops_seed_corpus/multiline differ
diff --git a/tests/fuzz/fuzz_geo_ops_seed_corpus/multipoint b/tests/fuzz/fuzz_geo_ops_seed_corpus/multipoint
new file mode 100644
index 000000000..e3bb94ac4
Binary files /dev/null and b/tests/fuzz/fuzz_geo_ops_seed_corpus/multipoint differ
diff --git a/tests/fuzz/fuzz_geo_ops_seed_corpus/multipolygon b/tests/fuzz/fuzz_geo_ops_seed_corpus/multipolygon
new file mode 100644
index 000000000..c4243e993
Binary files /dev/null and b/tests/fuzz/fuzz_geo_ops_seed_corpus/multipolygon differ
diff --git a/tests/fuzz/fuzz_geo_ops_seed_corpus/point b/tests/fuzz/fuzz_geo_ops_seed_corpus/point
new file mode 100644
index 000000000..86994e7d2
Binary files /dev/null and b/tests/fuzz/fuzz_geo_ops_seed_corpus/point differ
diff --git a/tests/fuzz/fuzz_geo_ops_seed_corpus/polygon_hole b/tests/fuzz/fuzz_geo_ops_seed_corpus/polygon_hole
new file mode 100644
index 000000000..db7830b0e
Binary files /dev/null and b/tests/fuzz/fuzz_geo_ops_seed_corpus/polygon_hole differ
-----------------------------------------------------------------------
Summary of changes:
tests/fuzz/CMakeLists.txt | 4 +
tests/fuzz/fuzz_geo_ops.c | 129 +++++++++++++++++++++++
tests/fuzz/fuzz_geo_ops_seed_corpus/bowtie | Bin 0 -> 36 bytes
tests/fuzz/fuzz_geo_ops_seed_corpus/geomcoll | Bin 0 -> 93 bytes
tests/fuzz/fuzz_geo_ops_seed_corpus/linestring | Bin 0 -> 32 bytes
tests/fuzz/fuzz_geo_ops_seed_corpus/multiline | Bin 0 -> 41 bytes
tests/fuzz/fuzz_geo_ops_seed_corpus/multipoint | Bin 0 -> 37 bytes
tests/fuzz/fuzz_geo_ops_seed_corpus/multipolygon | Bin 0 -> 72 bytes
tests/fuzz/fuzz_geo_ops_seed_corpus/point | Bin 0 -> 12 bytes
tests/fuzz/fuzz_geo_ops_seed_corpus/polygon_hole | Bin 0 -> 67 bytes
10 files changed, 133 insertions(+)
create mode 100644 tests/fuzz/fuzz_geo_ops.c
create mode 100644 tests/fuzz/fuzz_geo_ops_seed_corpus/bowtie
create mode 100644 tests/fuzz/fuzz_geo_ops_seed_corpus/geomcoll
create mode 100644 tests/fuzz/fuzz_geo_ops_seed_corpus/linestring
create mode 100644 tests/fuzz/fuzz_geo_ops_seed_corpus/multiline
create mode 100644 tests/fuzz/fuzz_geo_ops_seed_corpus/multipoint
create mode 100644 tests/fuzz/fuzz_geo_ops_seed_corpus/multipolygon
create mode 100644 tests/fuzz/fuzz_geo_ops_seed_corpus/point
create mode 100644 tests/fuzz/fuzz_geo_ops_seed_corpus/polygon_hole
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list