- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5bc33cb
committed
Add pg_encoding_set_invalid()
There are cases where we cannot / do not want to error out for invalidlyencoded input. In such cases it can be useful to replace e.g. an incompletemulti-byte characters with bytes that will trigger an error when gettingvalidated as part of a larger string.Unfortunately, until now, for some encoding no such sequence existed. Forthose encodings this commit removes one previously accepted input combination- we consider that to be ok, as the chosen bytes are outside of the validranges for the encodings, we just previously failed to detect that.As we cannot add a new field to pg_wchar_table without breaking ABI, this isimplemented "in-line" in the newly added function.Author: Noah Misch <noah@leadboat.com>Reviewed-by: Andres Freund <andres@anarazel.de>Backpatch-through: 13Security:CVE-2025-10941 parent04f31c8 commit5bc33cb
File tree
7 files changed
+121
-2
lines changed- src
- common
- include/mb
- test/regress
- expected
- input
- output
- sql
7 files changed
+121
-2
lines changedLines changed: 54 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
18 | 37 |
| |
19 | 38 |
| |
20 | 39 |
| |
| |||
1532 | 1551 |
| |
1533 | 1552 |
| |
1534 | 1553 |
| |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
1535 | 1559 |
| |
1536 | 1560 |
| |
1537 | 1561 |
| |
| |||
1581 | 1605 |
| |
1582 | 1606 |
| |
1583 | 1607 |
| |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
1584 | 1613 |
| |
1585 | 1614 |
| |
1586 | 1615 |
| |
| |||
1630 | 1659 |
| |
1631 | 1660 |
| |
1632 | 1661 |
| |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
1633 | 1667 |
| |
1634 | 1668 |
| |
1635 | 1669 |
| |
| |||
1858 | 1892 |
| |
1859 | 1893 |
| |
1860 | 1894 |
| |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
1861 | 1908 |
| |
1862 | 1909 |
| |
1863 | 1910 |
| |
| |||
1980 | 2027 |
| |
1981 | 2028 |
| |
1982 | 2029 |
| |
1983 |
| - | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
1984 | 2037 |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
359 | 359 |
| |
360 | 360 |
| |
361 | 361 |
| |
362 |
| - | |
| 362 | + | |
363 | 363 |
| |
364 | 364 |
| |
365 | 365 |
| |
| |||
573 | 573 |
| |
574 | 574 |
| |
575 | 575 |
| |
| 576 | + | |
576 | 577 |
| |
577 | 578 |
| |
578 | 579 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 |
| |
5 | 9 |
| |
6 | 10 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 |
| |
63 | 68 |
| |
64 | 69 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 |
| |
50 | 53 |
| |
51 | 54 |
| |
|
Lines changed: 50 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1089 | 1089 |
| |
1090 | 1090 |
| |
1091 | 1091 |
| |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1092 | 1142 |
| |
1093 | 1143 |
| |
1094 | 1144 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 |
| |
5 | 8 |
| |
6 | 9 |
| |
|
0 commit comments
Comments
(0)