aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/arrayutils.c
diff options
context:
space:
mode:
authorDean Rasheed <dean.a.rasheed@gmail.com>2023-11-09 12:10:14 +0000
committerDean Rasheed <dean.a.rasheed@gmail.com>2023-11-09 12:10:14 +0000
commit3850d4dec1d91c4fdce274f42986840444d5593e (patch)
tree0a9284641c901c15d11fe5329dd3530369a9ddac /src/backend/utils/adt/arrayutils.c
parenta4f7d33a904fcd4da7a12d249416dd2c5c5f2c1c (diff)
downloadpostgresql-3850d4dec1d91c4fdce274f42986840444d5593e.tar.gz
postgresql-3850d4dec1d91c4fdce274f42986840444d5593e.zip
Avoid integer overflow hazard in interval_time().
When casting an interval to a time, the original code suffered from 64-bit integer overflow for inputs with a sufficiently large negative "time" field, leading to bogus results. Fix by rewriting the algorithm in a simpler form, that more obviously cannot overflow. While at it, improve the test coverage to include negative interval inputs. Discussion: https://postgr.es/m/CAEZATCXoUKHkcuq4q63hkiPsKZJd0kZWzgKtU%2BNT0aU4wbf_Pw%40mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/arrayutils.c')
0 files changed, 0 insertions, 0 deletions