util: Fix segfault in the func ConstructLocalPath 23/14223/3
authorCheyenne Wills <cwills@sinenomine.net>
Fri, 29 May 2020 16:36:13 +0000 (10:36 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 30 May 2020 18:40:38 +0000 (14:40 -0400)
commited9a3b7165ae2300ebb185ca53e698e5ef93173b
treef325a966f85a385fc432d52dfc98f402599d66d1
parent336f5d91c6f4e93f77560d456fb29fbd82b237e5
util: Fix segfault in the func ConstructLocalPath

The function ConstructLocalPath will segfault if passed a NULL for
the command path parameter.

Update ConstructLocalPath to test the passed command path for a NULL
and return ENOENT.

The segfault can be triggered by setting up a BosConfig with a dafs
bnode that does not contain all the required parms.  This setup results
in bosserver segfaulting.  With the fix, bosserver now logs an error and
exits cleanly.

Change-Id: I26015c8accd829f3101b073964777b41d16b07f7
Reviewed-on: https://gerrit.openafs.org/14223
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/util/dirpath.c