forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commitc30f082
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 parent6b0b983 commitc30f082
File tree
5 files changed
+66
-11
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
5 files changed
+66
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3491 | 3491 | | |
3492 | 3492 | | |
3493 | 3493 | | |
3494 | | - | |
3495 | | - | |
3496 | | - | |
3497 | | - | |
3498 | | - | |
3499 | | - | |
3500 | | - | |
3501 | | - | |
3502 | | - | |
3503 | | - | |
3504 | | - | |
3505 | 3494 | | |
3506 | 3495 | | |
3507 | 3496 | | |
3508 | 3497 | | |
3509 | 3498 | | |
| 3499 | + | |
3510 | 3500 | | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
3511 | 3513 | | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
3512 | 3518 | | |
3513 | 3519 | | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
3514 | 3528 | | |
3515 | 3529 | | |
3516 | 3530 | | |
| |||
3522 | 3536 | | |
3523 | 3537 | | |
3524 | 3538 | | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
3525 | 3542 | | |
3526 | 3543 | | |
3527 | 3544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1806 | 1806 | | |
1807 | 1807 | | |
1808 | 1808 | | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
1809 | 1822 | | |
1810 | 1823 | | |
1811 | 1824 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2488 | 2488 | | |
2489 | 2489 | | |
2490 | 2490 | | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
2491 | 2504 | | |
2492 | 2505 | | |
2493 | 2506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
535 | 541 | | |
536 | 542 | | |
537 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
651 | 657 | | |
652 | 658 | | |
653 | 659 | | |
| |||
0 commit comments
Comments
(0)