From: Benjamin Kaduk Date: Sat, 2 Feb 2019 18:56:26 +0000 (-0600) Subject: vol: avoid -Wformat-truncation issues in vol-salvage.c X-Git-Tag: upstream/1.8.6_pre1^2~68 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=86a453f374a9aa201cf599ce4a0ca33d1522230a;p=packages%2Fo%2Fopenafs.git vol: avoid -Wformat-truncation issues in vol-salvage.c 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 Reviewed-by: Cheyenne Wills Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit d6b88e3bd5219a8dffebc07df23e30f1d16f095f) Change-Id: Idd388cd23ffeff1307b9eb6d31976383b6125260 Reviewed-on: https://gerrit.openafs.org/13733 Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index acde64b88..fb6c83d24 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -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);