Commit 3d5c332
committed
Repair various defects in dc21234.
pg_combinebackup had various problems:
* strncpy was used in various places where strlcpy should be used
instead, to avoid any possibility of the result not being
\0-terminated.
* scan_for_existing_tablespaces() failed to close the directory,
and an error when opening the directory was reported with the
wrong pathname.
* write_reconstructed_file() contained some redundant and therefore
dead code.
* flush_manifest() didn't check the result of pg_checksum_update()
as we do in other places, and misused a local pathname variable
that shouldn't exist at all.
In pg_basebackup, the wrong variable name was used in one place,
due to a copy and paste that was not properly adjusted.
In blkreftable.c, the loop incorrectly doubled chunkno instead of
max_chunks. Fix that. Also remove a nearby assertion per repeated
off-list complaints from Tom Lane.
Per Coverity and subsequent code inspection by me and by Tom Lane.
Discussion: http://postgr.es/m/CA+Tgmobvqqj-DW9F7uUzT-cQqs6wcVb-Xhs=w=hzJnXSE-kRGw@mail.gmail.com1 parent ee1bfd1 commit 3d5c332
File tree
5 files changed
+18
-17
lines changed- src
- bin
- pg_basebackup
- pg_combinebackup
- common
5 files changed
+18
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
712 | | - | |
| 712 | + | |
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
777 | | - | |
| 776 | + | |
| 777 | + | |
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
858 | | - | |
| 858 | + | |
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
| |||
1131 | 1131 | | |
1132 | 1132 | | |
1133 | 1133 | | |
1134 | | - | |
| 1134 | + | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
1206 | | - | |
1207 | | - | |
| 1206 | + | |
| 1207 | + | |
1208 | 1208 | | |
1209 | 1209 | | |
1210 | 1210 | | |
| |||
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
1241 | 1244 | | |
1242 | 1245 | | |
1243 | 1246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
581 | | - | |
| 580 | + | |
582 | 581 | | |
583 | 582 | | |
584 | 583 | | |
585 | 584 | | |
586 | | - | |
| 585 | + | |
587 | 586 | | |
588 | 587 | | |
589 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | 244 | | |
247 | 245 | | |
248 | 246 | | |
| |||
260 | 258 | | |
261 | 259 | | |
262 | 260 | | |
263 | | - | |
| 261 | + | |
264 | 262 | | |
265 | 263 | | |
266 | | - | |
| 264 | + | |
267 | 265 | | |
268 | 266 | | |
269 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
991 | | - | |
992 | | - | |
| 991 | + | |
993 | 992 | | |
994 | 993 | | |
995 | 994 | | |
| |||
0 commit comments