rmtsys: Don't overflow pathname buffer
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Mar 2013 10:15:10 +0000 (10:15 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Jun 2014 16:40:39 +0000 (12:40 -0400)
commitda3dc59ce087ff2128a96f4dbf171e7ec38af218
tree31ec733da4533856ef8fcdc2f9a2e1f72d02f4fa
parent049e7650a81866c4b32b8a5189780d0a4379ea44
rmtsys: Don't overflow pathname buffer

When we're constructing a homedirectory path to look for the
.AFSSERVER file in, we copy the HOME environment variable into a
static buffer, with a risk of overflowing that buffer.

Instead of using a static buffer, just allocate one with asprintf.

Caught by coverity (#985910)

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

Change-Id: I588fecf4caee64915fc2e7730f68f051d6faa92a
Reviewed-on: http://gerrit.openafs.org/11043
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/sys/rmtsysc.c