diff options
author | Jeremy Allison <jra@samba.org> | 2005-11-07 19:18:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:20 -0500 |
commit | 90230ac96279b468dc7163025c11970632d8b33e (patch) | |
tree | c7a62e8edf2bb678f38d3ba734e88d875c9fb0de /source3 | |
parent | 9df784b6f2fbcbc117992cc8f5f2a0b8c7d82275 (diff) | |
download | samba-90230ac96279b468dc7163025c11970632d8b33e.tar.gz samba-90230ac96279b468dc7163025c11970632d8b33e.tar.bz2 samba-90230ac96279b468dc7163025c11970632d8b33e.zip |
r11560: Fix core dump if setmntent returns NULL.
Pointed out by Jay Fanlason @ Red Hat.
Jeremy.
(This used to be commit e8136ae746b5be51b252d900aa732c8106fefcaf)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/sysquotas.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c index 52a598a4e6..c1ab6ef8cf 100644 --- a/source3/lib/sysquotas.c +++ b/source3/lib/sysquotas.c @@ -67,6 +67,9 @@ static int sys_path_to_bdev(const char *path, char **mntpath, char **bdev, char devno = S.st_dev ; fp = setmntent(MOUNTED,"r"); + if (fp == NULL) { + return -1; + } while ((mnt = getmntent(fp))) { if ( sys_stat(mnt->mnt_dir,&S) == -1 ) |