forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit991f8cf
committed
Detect integer overflow in array_set_slice().
When provided an empty initial array, array_set_slice() fails tocheck for overflow when computing the new array's dimensions.While such overflows are ordinarily caught by ArrayGetNItems(),commands with the following form are accepted:INSERT INTO t (i[-2147483648:2147483647]) VALUES ('{}');To fix, perform the hazardous computations using overflow-detectingarithmetic routines. As with commit18b5851, the added testcases generate errors that include a platform-dependent value, sowe again use psql's VERBOSITY parameter to suppress printing themessage text.Reported-by: Alexander LakhinAuthor: Joseph KoshakowReviewed-by: Jian HeDiscussion:https://postgr.es/m/31ad2cd1-db94-bdb3-f91a-65ffdb4bef95%40gmail.comBackpatch-through: 121 parentd3cc5ff commit991f8cf
File tree
3 files changed
+14
-1
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+14
-1
lines changedLines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2887 | 2887 |
| |
2888 | 2888 |
| |
2889 | 2889 |
| |
2890 |
| - | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
2891 | 2898 |
| |
2892 | 2899 |
| |
2893 | 2900 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1427 | 1427 |
| |
1428 | 1428 |
| |
1429 | 1429 |
| |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
1430 | 1434 |
| |
1431 | 1435 |
| |
1432 | 1436 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
447 | 447 |
| |
448 | 448 |
| |
449 | 449 |
| |
| 450 | + | |
| 451 | + | |
450 | 452 |
| |
451 | 453 |
| |
452 | 454 |
| |
|
0 commit comments
Comments
(0)