Skip to content

Commit

Permalink
Merge pull request #9622 from davidlt/fix-findMount-74X
Browse files Browse the repository at this point in the history
Resolve null-dereference and enable Linux containers
  • Loading branch information
cmsbuild committed Jun 16, 2015
2 parents 0fe5383 + cca6422 commit 903fa6a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Utilities/StorageFactory/src/LocalFileSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,14 @@ LocalFileSystem::initFSList(void)

free(mtab);
#else
const char * const _PATH_MOUNTED_LINUX = "/proc/self/mounts";
struct mntent *m;
FILE *mtab = setmntent(_PATH_MOUNTED, "r");
FILE *mtab = setmntent(_PATH_MOUNTED_LINUX, "r");
if (! mtab)
{
int nerr = errno;
edm::LogWarning("LocalFileSystem::initFSList()")
<< "Cannot read '" << _PATH_MOUNTED << "': "
<< "Cannot read '" << _PATH_MOUNTED_LINUX << "': "
<< strerror(nerr) << " (error " << nerr << ")";
return -1;
}
Expand Down Expand Up @@ -366,7 +367,7 @@ LocalFileSystem::findMount(const char *path, struct statfs *sfs, struct stat *s,
}
}
// In the case of a bind mount, try looking again at the source directory.
if (best->bind && best->origin)
if (best && best->bind && best->origin)
{
struct stat s2;
struct statfs sfs2;
Expand Down

0 comments on commit 903fa6a

Please sign in to comment.