forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6c1b71b
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 parent78ff6e0 commit6c1b71b
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 | |
---|---|---|---|
| |||
2872 | 2872 |
| |
2873 | 2873 |
| |
2874 | 2874 |
| |
2875 |
| - | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
2876 | 2883 |
| |
2877 | 2884 |
| |
2878 | 2885 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1368 | 1368 |
| |
1369 | 1369 |
| |
1370 | 1370 |
| |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1371 | 1375 |
| |
1372 | 1376 |
| |
1373 | 1377 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
418 | 418 |
| |
419 | 419 |
| |
420 | 420 |
| |
| 421 | + | |
| 422 | + | |
421 | 423 |
| |
422 | 424 |
| |
423 | 425 |
| |
|
0 commit comments
Comments
(0)