postgresql/src
Tom Lane 126cdaf47a Don't assume GSSAPI result strings are null-terminated.
Our uses of gss_display_status() and gss_display_name() assumed
that the gss_buffer_desc strings returned by those functions are
null-terminated.  It appears that they generally are, given the
lack of field complaints up to now.  However, the available
documentation does not promise this, and some man pages
for gss_display_status() show examples that rely on the
gss_buffer_desc.length field instead of expecting null
termination.  Also, we now have a report that on some
implementations, clang's address sanitizer is of the opinion
that the byte after the specified length is undefined.

Hence, change the code to rely on the length field instead.

This might well be cosmetic rather than fixing any real bug, but
it's hard to be sure, so back-patch to all supported branches.
While here, also back-patch the v12 changes that made pg_GSS_error
deal honestly with multiple messages available from
gss_display_status.

Per report from Sudheer H R.

Discussion: https://postgr.es/m/5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com
2021-06-23 14:01:32 -04:00
..
backend Don't assume GSSAPI result strings are null-terminated. 2021-06-23 14:01:32 -04:00
bin Translation updates 2021-06-21 12:33:50 +02:00
common Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
fe_utils Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
include Support disabling index bypassing by VACUUM. 2021-06-18 20:04:07 -07:00
interfaces Don't assume GSSAPI result strings are null-terminated. 2021-06-23 14:01:32 -04:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Restore the portal-level snapshot for simple expressions, too. 2021-06-22 17:48:39 -04:00
port Fix error handling in replacement pthread_barrier_init(). 2021-06-01 11:31:06 +12:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
timezone Update time zone data files to tzdata release 2021a. 2021-01-24 16:29:47 -05:00
tools Add list of ignorable pgindent commits for git-blame. 2021-06-22 09:06:32 -07:00
tutorial doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial 2021-04-08 10:51:26 +02:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Update Unicode data to CLDR 39 2021-04-08 08:28:03 +02:00
Makefile.shlib
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00