mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-20 05:53:23 +02:00
seg stores the number of significant digits in an input number in a "char" field. If char is signed, and the input is more than 127 digits long, the count can read out as negative causing seg_out() to print garbage (or, if you're really unlucky, even crash). To fix, clamp the digit count to be not more than FLT_DIG. (In theory this loses some information about what the original input was, but it doesn't seem like useful information; it would not survive dump/restore in any case.) Also, in case there are stored values of the seg type containing bad data, add a clamp in seg_out's restore() subroutine. Per bug #17725 from Robins Tharakan. It's been like this forever, so back-patch to all supported branches. Discussion: https://postgr.es/m/17725-0a09313b67fbe86e@postgresql.org |
||
---|---|---|
.. | ||
data | ||
expected | ||
sql | ||
.gitignore | ||
Makefile | ||
seg--1.0--1.1.sql | ||
seg--1.1--1.2.sql | ||
seg--1.1.sql | ||
seg--1.2--1.3.sql | ||
seg--1.3--1.4.sql | ||
seg-validate.pl | ||
seg.c | ||
seg.control | ||
segdata.h | ||
segparse.y | ||
segscan.l | ||
sort-segments.pl |