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;
|
return -EINVAL;
|
||||||
|
|
||||||
t = unit_type_from_string(value);
|
t = unit_type_from_string(value);
|
||||||
/* The activation details vtable has defined ops only for path
|
if (t < 0)
|
||||||
* and timer units */
|
return t;
|
||||||
if (!IN_SET(t, UNIT_PATH, UNIT_TIMER))
|
|
||||||
|
/* The activation details vtable has defined ops only for path and timer units */
|
||||||
|
if (!activation_details_vtable[t])
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
*details = malloc0(activation_details_vtable[t]->object_size);
|
*details = malloc0(activation_details_vtable[t]->object_size);
|
||||||
|
|
Loading…
Reference in a new issue