From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Avoid memcpy() with a NULL source pointer and count == 0 |
Date: | 2020-12-01 14:47:39 |
Message-ID: | E1kk6wN-0002uE-Ea@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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(dot)vf(at)gmail(dot)com>
Reported-by: Zhihong Yu <zyu(at)yugabyte(dot)com>
Discussion: https://postgr.es/m/CAEudQApUndmQkr5fLrCKXQ7+ib44i7S+Kk93pyVThS85PnG3bQ@mail.gmail.com
Discussion: https://postgr.es/m/CALNJ-vSdhwSM5f4tnNn1cdLHvXMVe_S+V3nR5GwNrmCPNB2VtQ@mail.gmail.com
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/49aaabdf8d0b85cbf19537bb8bc12856f2e9dc4d
Modified Files
--------------
src/backend/commands/indexcmds.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-12-01 19:03:07 | pgsql: Ensure that expandTableLikeClause() re-examines the same table. |
Previous Message | Heikki Linnakangas | 2020-12-01 12:38:35 | pgsql: docs: ulink all references to RFC's |