forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb527394
committed
Ensure maxlen is at leat 1 in dict_int
The dict_int text search dictionary template accepts maxlen parameter,which is then used to cap the length of input strings. The value wasnot properly checked, and the code simply does txt[d->maxlen] = '\0';to insert a terminator, leading to segfaults with negative values.This commit simply rejects values less than 1. The issue was there sincedct_int was introduced in 9.3, so backpatch all the way back to 9.4which is the oldest supported version.Reported-by: ciliDiscussion:https://postgr.es/m/16144-a36a5bef7657047d@postgresql.orgBackpatch-through: 9.41 parentbf39b3a commitb527394
File tree
3 files changed
+9
-0
lines changed- contrib/dict_int
- expected
- sql
3 files changed
+9
-0
lines changedLines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 |
| |
49 | 54 |
| |
50 | 55 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
300 | 300 |
| |
301 | 301 |
| |
302 | 302 |
| |
| 303 | + | |
| 304 | + |
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
| 54 | + | |
| 55 | + |
0 commit comments
Comments
(0)