Opened 7 years ago

Closed 7 years ago

#6931 closed defect (fixed)

ogr_geo_utils.cpp: Check LatA == 0.0 and cos_Heading == 0.0? Or with epsilons?

Reported by: Kurt Schwehr Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Even,

Did you really want an exact == 0.0 for these?

if( cos_complement_LatA == 0.0 && cos_Heading == 0.0 )

https://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogr_geo_utils.cpp?rev=39193#L170

Change History (2)

comment:1 by Even Rouault, 7 years ago

I'm not sure of all conditions that can lead to dfDenomin being 0, and appropriate thresholds. And potentially when it is very close to 0 the result might be inaccurate/wrong too. This function is indeed a bit fragile on corner cases that oss-fuzz finds. But for real world cases, those situations are quite unlikely. So I'm basically on a mode of "do fixes as much as oss-fuzz complains and not more".

comment:2 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 39389:

OGR_GreatCircle_ExtendPosition: avoid division by zero. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2424. Fixes #6931. Credit to OSS Fuzz

Note: See TracTickets for help on using tickets.