mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
core/unit: check the validity of unit type with activation_details_vtable
Follow-up for 24e91e08f8
.
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…
Reference in a new issue