Commit 13bba02
committed
Avoid calling memcpy() with a NULL source pointer and count == 0.
As in commit 0a52d37, avoid doing something that has undefined
results according to the C standard, even though in practice there does
not seem to be any problem with it.
This fixes two places in numeric.c that demonstrably could call memcpy()
with such arguments. I looked through that file and didn't see any other
places with similar hazards; this is not to claim that there are not such
places in other files.
Per report from Piotr Stefaniak. Back-patch to 9.5 which is where the
previous commit was added. We're more or less setting a precedent that
we will not worry about this type of issue in pre-9.5 branches unless
someone demonstrates a problem in the field.1 parent cb3384a commit 13bba02
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4769 | 4769 | | |
4770 | 4770 | | |
4771 | 4771 | | |
4772 | | - | |
| 4772 | + | |
| 4773 | + | |
| 4774 | + | |
4773 | 4775 | | |
4774 | 4776 | | |
4775 | 4777 | | |
| |||
5090 | 5092 | | |
5091 | 5093 | | |
5092 | 5094 | | |
5093 | | - | |
5094 | 5095 | | |
| 5096 | + | |
| 5097 | + | |
5095 | 5098 | | |
5096 | 5099 | | |
5097 | 5100 | | |
| |||
0 commit comments