diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-12-01 11:46:56 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-12-01 11:46:56 -0300 |
commit | 49aaabdf8d0b85cbf19537bb8bc12856f2e9dc4d (patch) | |
tree | 4a92d40ea40624c0fe90802d25c4a608eb3b094b /src/backend/parser/parse_utilcmd.c | |
parent | d5706ad7b70a03c53d06abff019d4cc56342ab09 (diff) | |
download | postgresql-49aaabdf8d0b85cbf19537bb8bc12856f2e9dc4d.tar.gz postgresql-49aaabdf8d0b85cbf19537bb8bc12856f2e9dc4d.zip |
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 13bba02271dc.
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
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions