Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: null pointer deref on col #943

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions capi/geos_ts_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ extern "C" {
{
return execute(extHandle, [&]() {
BufferParameters bp;
//-- use default cap style ROUND
//-- use default cap style ROUND
bp.setQuadrantSegments(quadsegs);

if(joinStyle > BufferParameters::JOIN_BEVEL) {
Expand Down Expand Up @@ -2069,10 +2069,11 @@ extern "C" {
GeometryCollection *col = dynamic_cast<GeometryCollection*>(collection);
if (!col) {
handle->ERROR_MESSAGE("Parameter collection of GEOSGeom_releaseCollection_r must not be a collection");
} else {
*ngeoms = static_cast<unsigned int>(col->getNumGeometries());
}

// Early exit on empty/null input
*ngeoms = static_cast<unsigned int>(col->getNumGeometries());
if (!col || *ngeoms == 0) {
return static_cast<Geometry**>(nullptr);
}
Expand Down
Loading