Fix pg_strtof() to not crash on NULL endptr.
authorTom Lane <[email protected]>
Sat, 1 Mar 2025 19:22:56 +0000 (14:22 -0500)
committerTom Lane <[email protected]>
Sat, 1 Mar 2025 19:22:56 +0000 (14:22 -0500)
commit76fbb38ef69c9210b4ba839b541f7f307817294f
tree632c9e3ff7da2a2d989ab9510fa69f86857f9ce8
parent35a591a0486fb5527b11ff1878f0ccaa0e672676
Fix pg_strtof() to not crash on NULL endptr.

We had managed not to notice this simple oversight because none
of our calls exercised the case --- until commit 8f427187d.
That led to pg_dump crashing on any platform that uses this code
(currently Cygwin and Mingw).

Even though there's no immediate bug in the back branches, backpatch,
because a non-POSIX-compliant strtof() substitute is trouble waiting
to happen for extensions or future back-patches.

Diagnosed-by: Alexander Lakhin <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/339b3902-4e98-4e31-a744-94e43b7b9292@gmail.com
Backpatch-through: 13
src/port/strtof.c