]> err.no Git - util-linux/commitdiff
mount: segfault when creating mtab and cannot determine fsname
authorLaMont Jones <lamont@debian.org>
Fri, 13 Feb 2009 18:59:53 +0000 (11:59 -0700)
committerLaMont Jones <lamont@debian.org>
Fri, 13 Feb 2009 18:59:53 +0000 (11:59 -0700)
Addresses-Debian-Bug: 488312
Signed-off-by: LaMont Jones <lamont@debian.org>
mount/mount.c

index 75d50defcfc46073b7b992f161bd99decc546023..bc254bfdb36252f8b4fe7c51a6537bc7491b5b34 100644 (file)
@@ -567,7 +567,7 @@ create_mtab (void) {
                mnt.mnt_freq = mnt.mnt_passno = 0;
                free(extra_opts);
 
-               if (my_addmntent (mfp, &mnt) == 1) {
+               if (mnt.mnt_fsname && my_addmntent (mfp, &mnt) == 1) {
                        int errsv = errno;
                        die (EX_FILEIO, _("mount: error writing %s: %s"),
                             _PATH_MOUNTED, strerror (errsv));