From e8136ae746b5be51b252d900aa732c8106fefcaf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 7 Nov 2005 19:18:00 +0000 Subject: r11560: Fix core dump if setmntent returns NULL. Pointed out by Jay Fanlason @ Red Hat. Jeremy. --- source/lib/sysquotas.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/lib/sysquotas.c') 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 ) -- cgit