rxkad: v5der.c format truncation warnings 61/13661/13
authorCheyenne Wills <cwills@sinenomine.net>
Mon, 15 Jul 2019 14:38:24 +0000 (08:38 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 26 Jul 2019 13:05:29 +0000 (09:05 -0400)
commit98ca332c4a5ac9e5687fb4fe21b350134bc74d1b
treeccf84749d60fd69affefa154fa8b4e40033b76a1
parenteaae6eba8ca10ba7a5a20ee0d1b5f91bc2bac6c6
rxkad: v5der.c format truncation warnings

GCC 7 is producing new warnings due to better compile time analysis.
With --enable-checking v5der.c is failing with 2 errors due to possible
format-truncation in some snprintf calls.  The format strings are being
used to format a date and time values from a tm structure.

The actual warnings/errors are being triggered from arithmetic being
performed on the year and month members of the structure. The resulting
values should not exceed the format lengths, but the compilers are still
flagging the statements.

v5der.c is part of the heimdal package that is pulled into the openafs
source tree.  v5der.c is not compiled directly but is #included in
ticket5.c

Update ticket5.c to change the severity of the format-truncation
diagnostic to a warning if using GCC 7 (or higher).

Note: since v5der.c is pulled from an external source (heimdal), any
changes to update v5der.c directly would need to be performed upstream.

Change-Id: Icda0d86444f505604abe9fa1cc2450d7538be7ef
Reviewed-on: https://gerrit.openafs.org/13661
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
CODING
src/rxkad/ticket5.c