forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3850d4d
committed
Avoid integer overflow hazard in interval_time().
When casting an interval to a time, the original code suffered from64-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 obviouslycannot overflow. While at it, improve the test coverage to includenegative interval inputs.Discussion:https://postgr.es/m/CAEZATCXoUKHkcuq4q63hkiPsKZJd0kZWzgKtU%2BNT0aU4wbf_Pw%40mail.gmail.com1 parenta4f7d33 commit3850d4d
File tree
3 files changed
+17
-12
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+17
-12
lines changedLines changed: 3 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2012 | 2012 |
| |
2013 | 2013 |
| |
2014 | 2014 |
| |
2015 |
| - | |
2016 | 2015 |
| |
2017 |
| - | |
2018 |
| - | |
2019 |
| - | |
2020 |
| - | |
2021 |
| - | |
2022 |
| - | |
2023 |
| - | |
2024 |
| - | |
2025 |
| - | |
2026 |
| - | |
2027 |
| - | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
2028 | 2019 |
| |
2029 | 2020 |
| |
2030 | 2021 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
981 | 981 |
| |
982 | 982 |
| |
983 | 983 |
| |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
984 | 996 |
| |
985 | 997 |
| |
986 | 998 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
182 | 182 |
| |
183 | 183 |
| |
184 | 184 |
| |
| 185 | + | |
| 186 | + | |
185 | 187 |
| |
186 | 188 |
| |
187 | 189 |
| |
|
0 commit comments
Comments
(0)