forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc0c8807
committed
Make json{b}_populate_recordset() use the right tuple descriptor.
json{b}_populate_recordset() used the tuple descriptor created from thequery-level AS clause without worrying about whether it matched the actualinput record type. If it didn't, that would usually result in a crash,though disclosure of server memory contents seems possible as well, for askilled attacker capable of issuing crafted SQL commands. Instead, usethe query-supplied descriptor only when there is no input tuple to look at,and otherwise get a tuple descriptor based on the input tuple's own typemarking. The core code will detect any type mismatch in the latter case.Michael Paquier and Tom Lane, per a report from David Rowley.Back-patch to 9.3 where this functionality was introduced.Security:CVE-2017-150981 parentb500297 commitc0c8807
File tree
3 files changed
+55
-21
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+55
-21
lines changedLines changed: 37 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1601 | 1601 |
| |
1602 | 1602 |
| |
1603 | 1603 |
| |
1604 |
| - | |
1605 | 1604 |
| |
1606 | 1605 |
| |
1607 |
| - | |
1608 |
| - | |
1609 |
| - | |
1610 |
| - | |
1611 |
| - | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1612 | 1641 |
| |
1613 | 1642 |
| |
1614 | 1643 |
| |
1615 | 1644 |
| |
1616 |
| - | |
1617 | 1645 |
| |
1618 | 1646 |
| |
1619 | 1647 |
| |
| |||
1625 | 1653 |
| |
1626 | 1654 |
| |
1627 | 1655 |
| |
1628 |
| - | |
1629 |
| - | |
1630 |
| - | |
1631 |
| - | |
1632 |
| - | |
1633 |
| - | |
1634 |
| - | |
1635 |
| - | |
1636 |
| - | |
1637 |
| - | |
1638 |
| - | |
1639 |
| - | |
1640 |
| - | |
1641 |
| - | |
| 1656 | + | |
| 1657 | + | |
1642 | 1658 |
| |
1643 | 1659 |
| |
1644 | 1660 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
907 | 907 |
| |
908 | 908 |
| |
909 | 909 |
| |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + |
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
302 | 302 |
| |
303 | 303 |
| |
304 | 304 |
| |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + |
0 commit comments
Comments
(0)