mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 23:00:19 +01:00
device: ensure simple action sdata is a NUL-terminated bytestring
(cherry picked from commit 9639a176ff)
This commit is contained in:
parent
775893fc00
commit
35e86a0cef
1 changed files with 8 additions and 3 deletions
|
|
@ -5278,9 +5278,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