postgresql/src
Tom Lane a868931fec Fix insufficiently-paranoid GB18030 encoding verifier.
The previous coding effectively only verified that the second byte of a
multibyte character was in the expected range; moreover, it wasn't careful
to make sure that the second byte even exists in the buffer before touching
it.  The latter seems unlikely to cause any real problems in the field
(in particular, it could never be a problem with null-terminated input),
but it's still a bug.

Since GB18030 is not a supported backend encoding, the only thing we'd
really be doing with GB18030 text is converting it to UTF8 in LocalToUtf,
which would fail anyway on any invalid character for lack of a match in
its lookup table.  So the only user-visible consequence of this change
should be that you'll get "invalid byte sequence for encoding" rather than
"character has no equivalent" for malformed GB18030 input.  However,
impending changes to the GB18030 conversion code will require these tighter
up-front checks to avoid producing bogus results.
2015-05-15 11:04:02 -04:00
..
backend Fix insufficiently-paranoid GB18030 encoding verifier. 2015-05-15 11:04:02 -04:00
bin Support --verbose option in reindexdb. 2015-05-15 21:45:55 +09:00
common Reorganize our CRC source files again. 2015-04-14 17:03:42 +03:00
include Allow GiST distance function to return merely a lower-bound. 2015-05-15 14:26:51 +03:00
interfaces Fix parallel make risk with new check temp-install setup 2015-04-29 20:34:22 -04:00
makefiles Fix parallel make risk with new check temp-install setup 2015-04-29 20:34:22 -04:00
pl Support "expanded" objects, particularly arrays, for better performance. 2015-05-14 12:08:49 -04:00
port Fix various typos and grammar errors in comments. 2015-04-26 18:42:31 +02:00
template Remove duplicate specification of -Ae for HP-UX C compiler. 2015-01-13 22:52:11 -05:00
test Allow GiST distance function to return merely a lower-bound. 2015-05-15 14:26:51 +03:00
timezone Update time zone data files to tzdata release 2015a. 2015-01-30 22:45:44 -05:00
tools Enable transforms tests for python 2 on MSVC builds 2015-04-29 13:49:24 -04:00
tutorial Update copyright for 2015 2015-01-06 11:43:47 -05:00
.gitignore
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in doc build: use unique Makefile variable to control temp install 2015-05-12 12:30:50 -04:00
Makefile.shlib Add transforms feature 2015-04-26 10:33:14 -04:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00