forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc61a2f5
committed
Change the backend to reject strings containing invalidly-encoded multibyte
characters in all cases. Formerly we mostly just threw warnings for invalidinput, and failed to detect it at all if no encoding conversion was required.The tighter check is needed to defend against SQL-injection attacks as perCVE-2006-2313 (further details will be published after release). Embeddedzero (null) bytes will be rejected as well. The checks are applied duringinput to the backend (receipt from client or COPY IN), so it no longer seemsnecessary to check in textin() and related routines; any string arriving atthose functions will already have been validated. Conversion failurereporting (for characters with no equivalent in the destination encoding)has been cleaned up and made consistent while at it.Also, fix a few longstanding errors in little-used encoding conversionroutines: win1251_to_iso, win866_to_iso, euc_tw_to_big5, euc_tw_to_mic,mic_to_euc_tw were all broken to varying extents.Patches by Tatsuo Ishii and Tom Lane. Thanks to Akio Ishida and Yasuo Ohgakifor identifying the security issues.1 parent1f219cf commitc61a2f5
File tree
31 files changed
+1527
-932
lines changed- src
- backend
- commands
- utils
- adt
- mb
- conversion_procs
- cyrillic_and_mic
- euc_cn_and_mic
- euc_jp_and_sjis
- euc_kr_and_mic
- euc_tw_and_big5
- latin2_and_win1250
- latin_and_mic
- utf8_and_ascii
- utf8_and_big5
- utf8_and_cyrillic
- utf8_and_euc_cn
- utf8_and_euc_jp
- utf8_and_euc_kr
- utf8_and_euc_tw
- utf8_and_gb18030
- utf8_and_gbk
- utf8_and_iso8859
- utf8_and_iso8859_1
- utf8_and_johab
- utf8_and_sjis
- utf8_and_uhc
- utf8_and_win
- include/mb
- test/mb/expected
31 files changed
+1527
-932
lines changedLines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1023 | 1023 |
| |
1024 | 1024 |
| |
1025 | 1025 |
| |
1026 |
| - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1027 | 1031 |
| |
1028 |
| - | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1029 | 1035 |
| |
1030 | 1036 |
| |
1031 | 1037 |
| |
|
Lines changed: 1 addition & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
53 | 52 |
| |
54 |
| - | |
55 |
| - | |
56 | 53 |
| |
57 | 54 |
| |
58 | 55 |
| |
|
Lines changed: 1 addition & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 | 76 |
| |
80 | 77 |
| |
81 | 78 |
| |
| |||
393 | 390 |
| |
394 | 391 |
| |
395 | 392 |
| |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 | 393 |
| |
400 | 394 |
| |
401 | 395 |
| |
|
Lines changed: 1 addition & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
256 | 256 |
| |
257 | 257 |
| |
258 | 258 |
| |
259 |
| - | |
260 | 259 |
| |
261 |
| - | |
262 |
| - | |
263 | 260 |
| |
264 | 261 |
| |
265 | 262 |
| |
| |||
299 | 296 |
| |
300 | 297 |
| |
301 | 298 |
| |
302 |
| - | |
303 |
| - | |
304 |
| - | |
305 | 299 |
| |
306 | 300 |
| |
307 | 301 |
| |
|
0 commit comments
Comments
(0)