postgresql/src
Alvaro Herrera 677f74e5bb
Avoid memcpy() with a NULL source pointer and count == 0
When memcpy() is called on a pointer, the compiler is entitled to assume
that the pointer is not null, which can lead to optimizing nearby code
in potentially undesirable ways.  We still want such optimizations
(gcc's -fdelete-null-pointer-checks) in cases where they're valid.

Related: commit 13bba02271.

Backpatch to pg11, where this particular instance appeared.

Reported-by: Ranier Vilela <ranier.vf@gmail.com>
Reported-by: Zhihong Yu <zyu@yugabyte.com>
Discussion: https://postgr.es/m/CAEudQApUndmQkr5fLrCKXQ7+ib44i7S+Kk93pyVThS85PnG3bQ@mail.gmail.com
Discussion: https://postgr.es/m/CALNJ-vSdhwSM5f4tnNn1cdLHvXMVe_S+V3nR5GwNrmCPNB2VtQ@mail.gmail.com
2020-12-01 11:46:56 -03:00
..
backend Avoid memcpy() with a NULL source pointer and count == 0 2020-12-01 11:46:56 -03:00
bin Fix recently-introduced breakage in psql's \connect command. 2020-11-29 15:22:04 -05:00
common Add support for abstract Unix-domain sockets 2020-11-25 08:33:57 +01:00
fe_utils Remove incorrect %s in string 2020-11-09 10:38:22 +01:00
include Use truncate(2) where appropriate. 2020-12-01 15:42:22 +13:00
interfaces Add support for abstract Unix-domain sockets 2020-11-25 08:33:57 +01:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Don't use custom OID symbols in pg_type.dat, either. 2020-10-29 13:33:38 -04:00
port Remove ability to independently select random number generator 2020-11-20 13:57:33 +01:00
template On macOS, use -isysroot in link steps as well as compile steps. 2020-11-20 00:07:09 -05:00
test Fix miscomputation of direct_lateral_relids for join relations. 2020-11-30 12:22:43 -05:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:23:47 -04:00
tools pg_stat_statements: Track number of times pgss entries were deallocated. 2020-11-26 21:18:05 +09:00
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00