forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7cac191
committed
Fix corner case bug in numeric to_char() some more.
The band-aid applied in commitf0bedf3 turns out to still needsome work: it made sure we didn't set Np->last_relevant too small(to the left of the decimal point), but it didn't prevent settingit too large (off the end of the partially-converted string).This could result in fetching data beyond the end of the allocatedspace, which with very bad luck could cause a SIGSEGV, thoughI don't see any hazard of interesting memory disclosure.Per bug #17839 from Thiago Nunes. The bug's pretty ancient,so back-patch to all supported versions.Discussion:https://postgr.es/m/17839-aada50db24d7b0da@postgresql.org1 parent7c509f7 commit7cac191
File tree
3 files changed
+16
-2
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+16
-2
lines changedLines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5684 | 5684 |
| |
5685 | 5685 |
| |
5686 | 5686 |
| |
5687 |
| - | |
| 5687 | + | |
| 5688 | + | |
| 5689 | + | |
5688 | 5690 |
| |
5689 | 5691 |
| |
5690 | 5692 |
| |
| 5693 | + | |
5691 | 5694 |
| |
5692 | 5695 |
| |
5693 |
| - | |
| 5696 | + | |
| 5697 | + | |
| 5698 | + | |
| 5699 | + | |
| 5700 | + | |
5694 | 5701 |
| |
5695 | 5702 |
| |
5696 | 5703 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1929 | 1929 |
| |
1930 | 1930 |
| |
1931 | 1931 |
| |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
1932 | 1938 |
| |
1933 | 1939 |
| |
1934 | 1940 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
979 | 979 |
| |
980 | 980 |
| |
981 | 981 |
| |
| 982 | + | |
982 | 983 |
| |
983 | 984 |
| |
984 | 985 |
| |
|
0 commit comments
Comments
(0)