pgsql: Fix crash in close_ps() for NaN input coordinates. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix crash in close_ps() for NaN input coordinates.
Date
Msg-id E1bOUYN-0008Pl-Rv@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix crash in close_ps() for NaN input coordinates.

The Assert() here seems unreasonably optimistic.  Andreas Seltenreich
found that it could fail with NaNs in the input geometries, and it
seems likely to me that it might fail in corner cases due to roundoff
error, even for ordinary input values.  As a band-aid, make the function
return SQL NULL instead of crashing.

Report: <87d1md1xji.fsf@credativ.de>

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/16e28fcec2fe235abddd501c17536c3b15a4dcec

Modified Files
--------------
src/backend/utils/adt/geo_ops.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix crash in close_ps() for NaN input coordinates.
Next
From: Tom Lane
Date:
Subject: pgsql: Add regression test case exercising the sorting path for hash in