ryantimwilson / rpms / systemd

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