]> git.michaelhowe.org Git - packages/o/openafs.git/commit
restorevol: replace snprintf with asprintf
authorCheyenne Wills <cwills@sinenomine.net>
Fri, 2 Aug 2019 16:31:13 +0000 (10:31 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sun, 9 Feb 2020 17:38:12 +0000 (12:38 -0500)
commit74891b3d29b762f68853a7b4bcd43b11cac2bbb7
tree2490df23832d9dfc81336f79ce1f98681c99d17c
parente1a450238f081f4be419cbd4340658f6b2f03133
restorevol: replace snprintf with asprintf

GCC is generating format-truncations warnings. With newer levels of gcc
(e.g. gcc8) and --checking-enabled these warnings result in errors and
failed builds.  In addition clang8 static analysis tools are reporting
memory leaks.

Replace snprintf with asprintf and eliminate some of the large work
buffers that are being placed on the stack. In order to correct some of
the format-truncation errors the size of the buffers grew significantly
(e.g. gcc is reporting the need to resize some of the buffers from 256
bytes to 4K in order to eliminate the warnings).

Ensure allocated work buffers are freed before function return.

Obtained a clean build with gcc9/clang8 with --enable-checking and a
clean scan-build report with clang8.

Reviewed-on: https://gerrit.openafs.org/13494
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit bf24b301a10dcb5710a98e58252213bd72c6f352)

Change-Id: If9fa37613841ffd090ec565dc24171bf89579c5b
Reviewed-on: https://gerrit.openafs.org/13750
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/volser/restorevol.c