aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonfuncs.c
diff options
context:
space:
mode:
authorDean Rasheed <dean.a.rasheed@gmail.com>2023-02-03 11:09:15 +0000
committerDean Rasheed <dean.a.rasheed@gmail.com>2023-02-03 11:09:15 +0000
commit86bfbeab4f439ad527318d9edeb3c71ea46c1ab3 (patch)
tree15b2510ba9571491633591a54d58ba2e8f436fa5 /src/backend/utils/adt/jsonfuncs.c
parent89d28f928c402e9f1890ece4d787825a6c51c2ca (diff)
downloadpostgresql-86bfbeab4f439ad527318d9edeb3c71ea46c1ab3.tar.gz
postgresql-86bfbeab4f439ad527318d9edeb3c71ea46c1ab3.zip
Make int64_div_fast_to_numeric() more robust.
The prior coding of int64_div_fast_to_numeric() had a number of bugs that would cause it to fail under different circumstances, such as with log10val2 <= 0, or log10val2 a multiple of 4, or in the "slow" numeric path with log10val2 >= 10. None of those could be triggered by any of our current code, which only uses log10val2 = 3 or 6. However, they made it a hazard for any future code that might use it. Also, since this is exported by numeric.c, users writing their own C code might choose to use it. Therefore fix, and back-patch to v14, where it was introduced. Dean Rasheed, reviewed by Tom Lane. Discussion: https://postgr.es/m/CAEZATCW8gXgW0tgPxPgHDPhVX71%2BSWFRkhnXy%2BTfGDsKLepu2g%40mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/jsonfuncs.c')
0 files changed, 0 insertions, 0 deletions