postgresql/contrib/pgcrypto
Tom Lane b0bc196e52 Clean up assorted failures under clang's -fsanitize=undefined checks.
Most of these are cases where we could call memcpy() or other libc
functions with a NULL pointer and a zero count, which is forbidden
by POSIX even though every production version of libc allows it.
We've fixed such things before in a piecemeal way, but apparently
never made an effort to try to get them all.  I don't claim that
this patch does so either, but it gets every failure I observe in
check-world, using clang 12.0.1 on current RHEL8.

numeric.c has a different issue that the sanitizer doesn't like:
"ln(-1.0)" will compute log10(0) and then try to assign the
resulting -Inf to an integer variable.  We don't actually use the
result in such a case, so there's no live bug.

Back-patch to all supported branches, with the idea that we might
start running a buildfarm member that tests this case.  This includes
back-patching c1132aae3 (Check the size in COPY_POINTER_FIELD),
which previously silenced some of these issues in copyfuncs.c.

Discussion: https://postgr.es/m/CALNJ-vT9r0DSsAOw9OXVJFxLENoVS_68kJ5x0p44atoYH+H4dg@mail.gmail.com
2022-03-03 18:13:24 -05:00
..
expected Add alternative output for OpenSSL 3 without legacy loaded 2021-09-25 11:27:28 +02:00
sql
.gitignore
blf.c
blf.h
crypt-blowfish.c
crypt-des.c
crypt-gensalt.c
crypt-md5.c Add missing error check in pgcrypto/crypt-md5.c. 2020-10-16 11:59:13 -04:00
imath.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
imath.h
internal-sha2.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
internal.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
Makefile Introduce --with-ssl={openssl} as a configure option 2021-02-01 19:19:44 +09:00
mbuf.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
mbuf.h
openssl.c Disable OpenSSL EVP digest padding in pgcrypto 2021-09-25 11:27:20 +02:00
pgcrypto--1.0--1.1.sql Add gen_random_uuid() to contrib/pgcrypto. 2014-01-17 16:52:06 -05:00
pgcrypto--1.1--1.2.sql
pgcrypto--1.2--1.3.sql
pgcrypto--1.3.sql
pgcrypto.c
pgcrypto.control
pgcrypto.h
pgp-armor.c
pgp-cfb.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
pgp-compress.c Fix some grammar and typos in comments and docs 2020-11-02 15:14:41 +09:00
pgp-decrypt.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
pgp-encrypt.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
pgp-info.c
pgp-mpi-internal.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
pgp-mpi-openssl.c
pgp-mpi.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
pgp-pgsql.c Refactor logic to check for ASCII-only characters in string 2020-12-21 09:37:11 +09:00
pgp-pubdec.c
pgp-pubenc.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
pgp-pubkey.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
pgp-s2k.c
pgp.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
pgp.h
px-crypt.c
px-crypt.h
px-hmac.c Remove custom memory allocation layer in pgcrypto 2020-09-25 10:25:55 +09:00
px.c Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
px.h Add error code for encryption failure in pgcrypto 2020-11-01 19:22:59 +09:00
rijndael.c
rijndael.h
rijndael.tbl