forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit547dd2c
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 parent9aa644f commit547dd2c
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 | |
---|---|---|---|
| |||
2899 | 2899 |
| |
2900 | 2900 |
| |
2901 | 2901 |
| |
2902 |
| - | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
2903 | 2910 |
| |
2904 | 2911 |
| |
2905 | 2912 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1402 | 1402 |
| |
1403 | 1403 |
| |
1404 | 1404 |
| |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
1405 | 1409 |
| |
1406 | 1410 |
| |
1407 | 1411 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
441 | 441 |
| |
442 | 442 |
| |
443 | 443 |
| |
| 444 | + | |
| 445 | + | |
444 | 446 |
| |
445 | 447 |
| |
446 | 448 |
| |
|
0 commit comments
Comments
(0)