naccyde / rpms / systemd

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