Commit b081fe4
committed
Fix corner case bug in numeric to_char() some more.
The band-aid applied in commit f0bedf3 turns out to still need
some 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 setting
it too large (off the end of the partially-converted string).
This could result in fetching data beyond the end of the allocated
space, which with very bad luck could cause a SIGSEGV, though
I 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 parent a563c24 commit b081fe4
File tree
3 files changed
+16
-2
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5695 | 5695 | | |
5696 | 5696 | | |
5697 | 5697 | | |
5698 | | - | |
| 5698 | + | |
| 5699 | + | |
| 5700 | + | |
5699 | 5701 | | |
5700 | 5702 | | |
5701 | 5703 | | |
| 5704 | + | |
5702 | 5705 | | |
5703 | 5706 | | |
5704 | | - | |
| 5707 | + | |
| 5708 | + | |
| 5709 | + | |
| 5710 | + | |
| 5711 | + | |
5705 | 5712 | | |
5706 | 5713 | | |
5707 | 5714 | | |
| |||
| 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 | | |
| |||
| 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