teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0071-mount-check-for-NULL-before-reading-pm-what.patch

a4b143
From 1f8cb5185ca41b891ebfa2e6aed093be49b958ce Mon Sep 17 00:00:00 2001
a4b143
From: Dave Reisner <dreisner@archlinux.org>
a4b143
Date: Fri, 4 Oct 2013 18:22:40 -0400
a4b143
Subject: [PATCH] mount: check for NULL before reading pm->what
a4b143
a4b143
Since a57f7e2c828b85, a mount unit with garbage in it would cause
a4b143
systemd to crash on loading it.
a4b143
a4b143
ref: https://bugs.freedesktop.org/show_bug.cgi?id=70148
a4b143
---
a4b143
 src/core/mount.c | 2 +-
a4b143
 1 file changed, 1 insertion(+), 1 deletion(-)
a4b143
a4b143
diff --git a/src/core/mount.c b/src/core/mount.c
a4b143
index 93bfa99..db055f0 100644
a4b143
--- a/src/core/mount.c
a4b143
+++ b/src/core/mount.c
a4b143
@@ -182,7 +182,7 @@ static int mount_add_mount_links(Mount *m) {
a4b143
          * for the source path (if this is a bind mount) to be
a4b143
          * available. */
a4b143
         pm = get_mount_parameters_fragment(m);
a4b143
-        if (pm && path_is_absolute(pm->what)) {
a4b143
+        if (pm && pm->what && path_is_absolute(pm->what)) {
a4b143
                 r = unit_require_mounts_for(UNIT(m), pm->what);
a4b143
                 if (r < 0)
a4b143
                         return r;