postgresql/src/backend
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
..
access Fix CLUSTER progress reporting of number of blocks scanned. 2020-11-27 20:16:44 +09:00
bootstrap Fix some stray whitespace in parser files 2020-11-11 17:37:18 +01:00
catalog Centralize logic for skipping useless ereport/elog calls. 2020-11-23 19:10:46 -05:00
commands Avoid memcpy() with a NULL source pointer and count == 0 2020-12-01 11:46:56 -03:00
executor Remove catalog function currtid() 2020-11-25 12:18:26 +09:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit Move per-agg and per-trans duplicate finding to the planner. 2020-11-24 10:45:00 +02:00
lib Use pg_bitutils for HyperLogLog. 2020-07-30 09:14:23 -07:00
libpq Make error hint from bind() failure more accurate 2020-11-25 08:33:57 +01:00
main Remove -o option to postmaster 2020-11-10 13:15:01 +01:00
nodes Fix missing outfuncs.c support for IncrementalSortPath. 2020-11-30 16:33:09 -05:00
optimizer Fix missing outfuncs.c support for IncrementalSortPath. 2020-11-30 16:33:09 -05:00
parser Refactor parsing rules for option lists of EXPLAIN, VACUUM and ANALYZE 2020-11-30 20:27:37 +09:00
partitioning Do not return NULL for error cases in satisfies_hash_partition(). 2020-11-16 16:39:59 -05:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Fix -Wcast-function-type warnings on Windows/MinGW 2020-10-21 08:17:51 +02:00
postmaster Rename PGPROC->vacuumFlags to statusFlags 2020-11-16 19:42:55 -03:00
regex Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
replication Fix replication of in-progress transactions in tablesync worker. 2020-11-27 07:43:34 +05:30
rewrite Improve wording of two error messages related to generated columns. 2020-11-23 11:15:12 -05:00
snowball code: replace most remaining uses of 'master'. 2020-07-08 13:24:35 -07:00
statistics Fix some grammar and typos in comments and docs 2020-11-02 15:14:41 +09:00
storage Use truncate(2) where appropriate. 2020-12-01 15:42:22 +13:00
tcop Improve log message about termination of background workers. 2020-11-30 11:05:19 +09:00
tsearch Improve behavior of tsearch_readline(), and remove t_readline(). 2020-09-23 20:26:58 -04:00
utils Avoid spamming the client with multiple ParameterStatus messages. 2020-11-25 11:40:44 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00