forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfb2aece
committed
Replace a few strncmp() calls with strlcpy().
strncmp() is a specialized API unsuited for routine copying intofixed-size buffers. On a system where the length of a single filenamecan exceed MAXPGPATH, the pg_archivecleanup change prevents a simplecrash in the subsequent strlen(). Few filesystems support names thatlong, and calling pg_archivecleanup with untrusted input is still not acredible use case. Therefore, no back-patch.David Rowley1 parent7fc5f1a commitfb2aece
File tree
2 files changed
+8
-2
lines changed- contrib/pg_archivecleanup
- src/backend/access/transam
2 files changed
+8
-2
lines changedLines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
111 |
| - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
112 | 117 |
| |
113 | 118 |
| |
114 | 119 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
459 | 459 |
| |
460 | 460 |
| |
461 | 461 |
| |
462 |
| - | |
| 462 | + | |
| 463 | + | |
463 | 464 |
| |
464 | 465 |
| |
465 | 466 |
| |
|
0 commit comments
Comments
(0)