mirror of
https://github.com/systemd/systemd.git
synced 2025-01-27 18:04:05 +03:00
core/unit: check the validity of unit type with activation_details_vtable
Follow-up for 24e91e08f8958241195f97472353adef94884b33.
This commit is contained in:
parent
d2132d3d8d
commit
210cb8d690
@ -6162,9 +6162,11 @@ int activation_details_deserialize(const char *key, const char *value, Activatio
|
||||
return -EINVAL;
|
||||
|
||||
t = unit_type_from_string(value);
|
||||
/* The activation details vtable has defined ops only for path
|
||||
* and timer units */
|
||||
if (!IN_SET(t, UNIT_PATH, UNIT_TIMER))
|
||||
if (t < 0)
|
||||
return t;
|
||||
|
||||
/* The activation details vtable has defined ops only for path and timer units */
|
||||
if (!activation_details_vtable[t])
|
||||
return -EINVAL;
|
||||
|
||||
*details = malloc0(activation_details_vtable[t]->object_size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user