forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita67c75f
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 parent3b45944 commita67c75f
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 | |
---|---|---|---|
| |||
5731 | 5731 |
| |
5732 | 5732 |
| |
5733 | 5733 |
| |
5734 |
| - | |
| 5734 | + | |
| 5735 | + | |
| 5736 | + | |
5735 | 5737 |
| |
5736 | 5738 |
| |
5737 | 5739 |
| |
| 5740 | + | |
5738 | 5741 |
| |
5739 | 5742 |
| |
5740 |
| - | |
| 5743 | + | |
| 5744 | + | |
| 5745 | + | |
| 5746 | + | |
| 5747 | + | |
5741 | 5748 |
| |
5742 | 5749 |
| |
5743 | 5750 |
| |
|
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)