Commit 9639a176 authored by Lubomir Rintel's avatar Lubomir Rintel

device: ensure simple action sdata is a NUL-terminated bytestring

parent 023ce50d
......@@ -5383,9 +5383,14 @@ tc_commit (NMDevice *self)
if (action) {
tfilter->action.kind = nm_tc_action_get_kind (action);
if (strcmp (tfilter->action.kind, "simple") == 0) {
strncpy (tfilter->action.simple.sdata,
g_variant_get_bytestring (nm_tc_action_get_attribute (action, "sdata")),
sizeof (tfilter->action.simple.sdata));
GVariant *sdata;
sdata = nm_tc_action_get_attribute (action, "sdata");
if (sdata && g_variant_is_of_type (sdata, G_VARIANT_TYPE_BYTESTRING)) {
g_strlcpy (tfilter->action.simple.sdata,
g_variant_get_bytestring (sdata),
sizeof (tfilter->action.simple.sdata));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment