forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf0ff52f
committed
Avoid memcpy() with a NULL source pointer and count == 0
When memcpy() is called on a pointer, the compiler is entitled to assumethat the pointer is not null, which can lead to optimizing nearby codein potentially undesirable ways. We still want such optimizations(gcc's -fdelete-null-pointer-checks) in cases where they're valid.Related: commit13bba02.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.comDiscussion:https://postgr.es/m/CALNJ-vSdhwSM5f4tnNn1cdLHvXMVe_S+V3nR5GwNrmCPNB2VtQ@mail.gmail.com1 parent50f3385 commitf0ff52f
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1091 | 1091 |
| |
1092 | 1092 |
| |
1093 | 1093 |
| |
| 1094 | + | |
| 1095 | + | |
1094 | 1096 |
| |
1095 | 1097 |
| |
1096 | 1098 |
| |
1097 | 1099 |
| |
1098 | 1100 |
| |
1099 | 1101 |
| |
1100 |
| - | |
| 1102 | + | |
| 1103 | + | |
1101 | 1104 |
| |
1102 |
| - | |
1103 | 1105 |
| |
1104 | 1106 |
| |
1105 | 1107 |
| |
|
0 commit comments
Comments
(0)