summaryrefslogtreecommitdiffstats
path: root/source/lib/sysquotas.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-11-07 19:18:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:20 -0500
commite8136ae746b5be51b252d900aa732c8106fefcaf (patch)
treeb6fcd8e20cea68324da9504fedbb213dde9005b6 /source/lib/sysquotas.c
parentbff03f0cd484c04d5ab6d6b66f30191bef368b68 (diff)
downloadsamba-e8136ae746b5be51b252d900aa732c8106fefcaf.tar.gz
samba-e8136ae746b5be51b252d900aa732c8106fefcaf.tar.xz
samba-e8136ae746b5be51b252d900aa732c8106fefcaf.zip
r11560: Fix core dump if setmntent returns NULL.
Pointed out by Jay Fanlason @ Red Hat. Jeremy.
Diffstat (limited to 'source/lib/sysquotas.c')
-rw-r--r--source/lib/sysquotas.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/lib/sysquotas.c b/source/lib/sysquotas.c
index 52a598a4e6b..c1ab6ef8cfa 100644
--- a/source/lib/sysquotas.c
+++ b/source/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 )