forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit38e8256
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 parentb7d6f75 commit38e8256
File tree
5 files changed
+63
-11
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
5 files changed
+63
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2696 | 2696 | | |
2697 | 2697 | | |
2698 | 2698 | | |
2699 | | - | |
2700 | | - | |
2701 | | - | |
2702 | | - | |
2703 | | - | |
2704 | | - | |
2705 | | - | |
2706 | | - | |
2707 | | - | |
2708 | | - | |
2709 | | - | |
2710 | 2699 | | |
2711 | 2700 | | |
2712 | 2701 | | |
2713 | 2702 | | |
2714 | 2703 | | |
| 2704 | + | |
2715 | 2705 | | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
2716 | 2718 | | |
| 2719 | + | |
2717 | 2720 | | |
2718 | 2721 | | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
2719 | 2730 | | |
2720 | 2731 | | |
2721 | 2732 | | |
| |||
2759 | 2770 | | |
2760 | 2771 | | |
2761 | 2772 | | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
2762 | 2776 | | |
2763 | 2777 | | |
2764 | 2778 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1408 | 1408 | | |
1409 | 1409 | | |
1410 | 1410 | | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1411 | 1424 | | |
1412 | 1425 | | |
1413 | 1426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2090 | 2090 | | |
2091 | 2091 | | |
2092 | 2092 | | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
2093 | 2106 | | |
2094 | 2107 | | |
2095 | 2108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
407 | 413 | | |
408 | 414 | | |
409 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
523 | 529 | | |
524 | 530 | | |
525 | 531 | | |
| |||
0 commit comments
Comments
(0)