mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
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>
This commit is contained in:
parent
336f5d91c6
commit
ed9a3b7165
@ -560,6 +560,9 @@ ConstructLocalPath(const char *cpath, const char *relativeTo,
|
||||
|
||||
*fullPathBufp = NULL;
|
||||
|
||||
if (cpath == NULL)
|
||||
return ENOENT;
|
||||
|
||||
while (isspace(*cpath)) {
|
||||
cpath++;
|
||||
}
|
||||
@ -654,6 +657,9 @@ ConstructLocalPath(const char *cpath, const char *relativeTo,
|
||||
|
||||
*fullPathBufp = NULL;
|
||||
|
||||
if (cpath == NULL)
|
||||
return ENOENT;
|
||||
|
||||
while (isspace(*cpath)) {
|
||||
cpath++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user