mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 12:20:09 +01:00
device: ensure simple action sdata is a NUL-terminated bytestring
This commit is contained in:
parent
023ce50d21
commit
9639a176ff
1 changed files with 8 additions and 3 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue