]> git.michaelhowe.org Git - packages/o/openafs.git/commit
auth: Don't overflow hostName array
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Mar 2013 09:59:20 +0000 (09:59 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Jun 2014 16:39:01 +0000 (12:39 -0400)
commita5b40254de63ade492da9508b7d0218a7fe07f30
treeeb204b29f633e4f0bb74ae76da2d8cf8703e4857
parent06f0b6022342879c5519ff1bd0f272e1bff4538a
auth: Don't overflow hostName array

afsconf_cell's hostName structure is a fixed length. Don't overflow
it by writing whatever comes back from gethostbyaddr into it. Use
strlcpy to catch an overflow, and if one occurs, just use
"UNKNOWNHOST", rather than a truncated host name.

Caught by coverity (#985906)

Reviewed-on: http://gerrit.openafs.org/9354
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit fed5dac9f25f7fbd74b6834ce6f087eaf31be2f2)

Change-Id: I468f66585e19623d62dee8730141767bd050ed1d
Reviewed-on: http://gerrit.openafs.org/11041
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/auth/writeconfig.c