]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: avoid -Wformat-truncation issues in vol-salvage.c
authorBenjamin Kaduk <kaduk@mit.edu>
Sat, 2 Feb 2019 18:56:26 +0000 (12:56 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sat, 25 Jan 2020 20:36:14 +0000 (15:36 -0500)
Make some formerly-64-character buffers VMAXPATHLEN (plus a smidgeon)
to give them space to hold the composed paths.

Reviewed-on: https://gerrit.openafs.org/13464
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d6b88e3bd5219a8dffebc07df23e30f1d16f095f)

Change-Id: Idd388cd23ffeff1307b9eb6d31976383b6125260
Reviewed-on: https://gerrit.openafs.org/13733
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/vol-salvage.c

index acde64b88b0bd53dd683d9d682b8b91362b697af..fb6c83d24666b38aefc3e8422e3f2b49b53934b2 100644 (file)
@@ -979,7 +979,7 @@ SalvageFileSys1(struct DiskPartition64 *partP, VolumeId singleVolumeNumber)
 void
 DeleteExtraVolumeHeaderFile(struct SalvInfo *salvinfo, struct VolumeSummary *vsp)
 {
-    char path[64];
+    char path[VMAXPATHLEN + 10];
     char filename[VMAXPATHLEN];
 
     if (vsp->deleted) {
@@ -2436,7 +2436,7 @@ SalvageVolumeHeaderFile(struct SalvInfo *salvinfo, struct InodeSummary *isp,
     }
 
     if (isp->volSummary == NULL) {
-       char path[64];
+       char path[VMAXPATHLEN];
        char headerName[64];
        snprintf(headerName, sizeof headerName, VFORMAT,
                 afs_printable_VolumeId_lu(isp->volumeId));
@@ -2454,7 +2454,7 @@ SalvageVolumeHeaderFile(struct SalvInfo *salvinfo, struct InodeSummary *isp,
 
        writefunc = VCreateVolumeDiskHeader;
     } else {
-       char path[64];
+       char path[VMAXPATHLEN];
        char headerName[64];
        /* hack: these two fields are obsolete... */
        isp->volSummary->header.volumeAcl = 0;
@@ -4374,7 +4374,7 @@ MaybeZapVolume(struct SalvInfo *salvinfo, struct InodeSummary *isp,
            }
            if (!Testing) {
                afs_int32 code;
-               char path[64];
+               char path[VMAXPATHLEN + 10];
                char filename[VMAXPATHLEN];
                VolumeExternalName_r(isp->volumeId, filename, sizeof(filename));
                sprintf(path, "%s" OS_DIRSEP "%s", salvinfo->fileSysPath, filename);