]> git.michaelhowe.org Git - packages/o/openafs.git/commit
ptserver: testpt.c format-overflow warning
authorCheyenne Wills <cwills@sinenomine.net>
Tue, 2 Jul 2019 22:58:28 +0000 (16:58 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sun, 26 Jan 2020 12:05:46 +0000 (07:05 -0500)
commitd5c2f53e9488311b294d871894967f78949699b6
treec4a5e42c8b30a99e867d7acbbcb49dc1742c2946
parent3cb29cf7768db45bcf1b49cd5aabd3802489a961
ptserver: testpt.c format-overflow warning

GCC 9 introduced new warnings/errors and is flagging a sprintf with a
format-overflow warning.  With --checking-enabled, this error is causing
testpt.c to fail during compile.

Change the buffer size from 16 bytes to PR_MAXNAMELEN+1 and use snprintf
instead of sprintf. Generate an error message and exit if snprintf
truncates the string.

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

Change-Id: I2f8012e7fb4384f3ad877d2c9beb5f00b03716b8
Reviewed-on: https://gerrit.openafs.org/13730
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/ptserver/testpt.c