]> git.michaelhowe.org Git - packages/o/openafs.git/commit
vol: check snprintf return values in namei_ops
authorBenjamin Kaduk <kaduk@mit.edu>
Sat, 2 Feb 2019 18:49:07 +0000 (12:49 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sun, 9 Feb 2020 17:53:53 +0000 (12:53 -0500)
commit2bb9dc093b65210a33ffa3b21e6173bbe0452a0c
tree6e401804631526765ed852dedd7d5251128b7902
parente849fbc4a8d86ef96c91a4011b1a57f4d7bf725c
vol: check snprintf return values in namei_ops

gcc8 is more aggressive about parsing format strings and computing bounds
on the generated text from functions like snprintf.  In this case it seems best
to detect cases of truncation and error out, rather than trying to increase
stack buffer sizes or switch to asprintf.  These paths should be well-behaved
since they are local to the fileserver, so this is mostly about appeasing the
compiler's -Wformat-truncation checks to allow us to build with --enable-checking.

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

Change-Id: Ie8f9005ad9cf7cdfd3eb472e01a6fdbde5b7e57e
Reviewed-on: https://gerrit.openafs.org/13732
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/namei_ops.c