]> git.michaelhowe.org Git - packages/o/openafs.git/commit
util: Avoid overflow in GetNameByINet
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Mar 2013 10:27:47 +0000 (10:27 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Jun 2014 16:51:12 +0000 (12:51 -0400)
commit7eb63cd21ee57312ca71930d59f49177d80f4f2a
tree858050c8f1e3ba0975ac46b315d796dfdf345a09
parent5ad98f49dfb52b9f20375a9163ec17dd184523b3
util: Avoid overflow in GetNameByINet

We copy the results of gethostbyaddr into a fixed length buffer
without checking whether they fit. Add a length check, and use
strlcpy to do the copy to make sure we can't overflow.

Caught by coverity (#985912, #985872)

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

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