forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita57d168
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 parent74e1546 commita57d168
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 | |
---|---|---|---|
| |||
2923 | 2923 |
| |
2924 | 2924 |
| |
2925 | 2925 |
| |
2926 |
| - | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
2927 | 2934 |
| |
2928 | 2935 |
| |
2929 | 2936 |
| |
|
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)