diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-05-04 16:56:28 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-05-05 22:15:23 +0200 |
commit | 24e91e08f8958241195f97472353adef94884b33 (patch) | |
tree | 4ff03a67b4923b4c5c0bf5a23f0a54c6e16a08d5 /src/core | |
parent | cc938f1ce0f1eafc435e0dd1d9fe45aaedc526e1 (diff) | |
download | systemd-24e91e08f8958241195f97472353adef94884b33.tar.gz |
core: check the unit type more thoroughly when deserializing
Resolves: #27523
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/unit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index c7635a291c..4e9ae6148f 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -6162,7 +6162,9 @@ int activation_details_deserialize(const char *key, const char *value, Activatio return -EINVAL; t = unit_type_from_string(value); - if (t == _UNIT_TYPE_INVALID) + /* The activation details vtable has defined ops only for path + * and timer units */ + if (!IN_SET(t, UNIT_PATH, UNIT_TIMER)) return -EINVAL; *details = malloc0(activation_details_vtable[t]->object_size); |