chiark / gitweb /
core/mount.c:mount_dump(): don't segfault, if mount is not mounted anymore
authorHarald Hoyer <harald@redhat.com>
Thu, 4 Jul 2013 09:01:47 +0000 (11:01 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 4 Jul 2013 10:01:15 +0000 (12:01 +0200)
Don't segfault, if m->from_proc_self_mountinfo and m->from_fragment is
false.

https://bugzilla.redhat.com/show_bug.cgi?id=957783#c9

src/core/mount.c

index 3cc3e65..58a3f11 100644 (file)
@@ -822,9 +822,9 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) {
                 prefix, mount_state_to_string(m->state),
                 prefix, mount_result_to_string(m->result),
                 prefix, m->where,
-                prefix, strna(p->what),
-                prefix, strna(p->fstype),
-                prefix, strna(p->options),
+                prefix, p ? strna(p->what) : "n/a",
+                prefix, p ? strna(p->fstype) : "n/a",
+                prefix, p ? strna(p->options) : "n/a",
                 prefix, yes_no(m->from_proc_self_mountinfo),
                 prefix, yes_no(m->from_fragment),
                 prefix, m->directory_mode);