forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit386a260
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 parent52e9a78 commit386a260
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 | |
---|---|---|---|
| |||
5685 | 5685 |
| |
5686 | 5686 |
| |
5687 | 5687 |
| |
5688 |
| - | |
| 5688 | + | |
| 5689 | + | |
| 5690 | + | |
5689 | 5691 |
| |
5690 | 5692 |
| |
5691 | 5693 |
| |
| 5694 | + | |
5692 | 5695 |
| |
5693 | 5696 |
| |
5694 |
| - | |
| 5697 | + | |
| 5698 | + | |
| 5699 | + | |
| 5700 | + | |
| 5701 | + | |
5695 | 5702 |
| |
5696 | 5703 |
| |
5697 | 5704 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1266 | 1266 |
| |
1267 | 1267 |
| |
1268 | 1268 |
| |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
1269 | 1275 |
| |
1270 | 1276 |
| |
1271 | 1277 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
799 | 799 |
| |
800 | 800 |
| |
801 | 801 |
| |
| 802 | + | |
802 | 803 |
| |
803 | 804 |
| |
804 | 805 |
| |
|
0 commit comments
Comments
(0)