ptserver: testpt.c format-overflow warning 63/13663/8
authorCheyenne Wills <cwills@sinenomine.net>
Tue, 2 Jul 2019 22:58:28 +0000 (16:58 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 26 Jul 2019 14:25:21 +0000 (10:25 -0400)
commit4a57cc54dfb6789a86ee735360ee44209c1a901a
tree308e6a1deb3bba5c7c9b1819808049bb30f8a616
parent41ee558329560bce037ad2860282d8b49aa11b2d
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.

Change-Id: I30fbe0971ba3e05dc6ac61e7b2ded2fd1777374d
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>
src/ptserver/testpt.c