forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9a9473f
committed
Prevent using strncpy with src == dest in TupleDescInitEntry.
The C and POSIX standards state that strncpy's behavior is undefined whensource and destination areas overlap. While it remains dubious whether anyimplementations really misbehave when the pointers are exactly equal, someplatforms are now starting to force the issue by complaining when anundefined call occurs. (In particular OS X 10.9 has been seen to dump corehere, though the exact set of circumstances needed to trigger that remainelusive. Similar behavior can be expected to be optional on Linux andother platforms in the near future.) So tweak the code to explicitly donothing when nothing need be done.Back-patch to all active branches. In HEAD, this also lets us get rid ofan exception in valgrind.supp.Per discussion of a report from Matthias Schmitt.1 parentd2aecae commit9a9473f
2 files changed
+10
-20
lines changedLines changed: 10 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
468 | 468 |
| |
469 | 469 |
| |
470 | 470 |
| |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
471 | 477 |
| |
472 | 478 |
| |
473 | 479 |
| |
| |||
501 | 507 |
| |
502 | 508 |
| |
503 | 509 |
| |
504 |
| - | |
| 510 | + | |
505 | 511 |
| |
506 |
| - | |
507 |
| - | |
508 |
| - | |
| 512 | + | |
509 | 513 |
| |
| 514 | + | |
| 515 | + | |
510 | 516 |
| |
511 | 517 |
| |
512 | 518 |
| |
|
Lines changed: 0 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 | 67 |
| |
84 | 68 |
| |
85 | 69 |
| |
|
0 commit comments
Comments
(0)