1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

r11560: Fix core dump if setmntent returns NULL.

Pointed out by Jay Fanlason @ Red Hat.
Jeremy.
(This used to be commit e8136ae746b5be51b252d900aa732c8106fefcaf)
This commit is contained in:
Jeremy Allison 2005-11-07 19:18:00 +00:00 committed by Gerald (Jerry) Carter
parent 9df784b6f2
commit 90230ac962

View File

@ -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 )