summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libnm-core/nm-setting-team-port.c10
-rw-r--r--libnm-core/nm-setting-team.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-team-port.c b/libnm-core/nm-setting-team-port.c
index 649d958273..f64aa5f947 100644
--- a/libnm-core/nm-setting-team-port.c
+++ b/libnm-core/nm-setting-team-port.c
@@ -117,6 +117,16 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
}
if (priv->config) {
+ if (strlen (priv->config) > 1*1024*1024) {
+ g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("team config exceeds size limit"));
+ g_prefix_error (error,
+ "%s.%s: ",
+ NM_SETTING_TEAM_PORT_SETTING_NAME,
+ NM_SETTING_TEAM_PORT_CONFIG);
+ return FALSE;
+ }
+
if (!nm_utils_is_json_object (priv->config, error)) {
g_prefix_error (error,
"%s.%s: ",
diff --git a/libnm-core/nm-setting-team.c b/libnm-core/nm-setting-team.c
index c49ebff2b2..e83ce309a4 100644
--- a/libnm-core/nm-setting-team.c
+++ b/libnm-core/nm-setting-team.c
@@ -89,6 +89,16 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
if (priv->config) {
+ if (strlen (priv->config) > 1*1024*1024) {
+ g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("team config exceeds size limit"));
+ g_prefix_error (error,
+ "%s.%s: ",
+ NM_SETTING_TEAM_SETTING_NAME,
+ NM_SETTING_TEAM_CONFIG);
+ return FALSE;
+ }
+
if (!nm_utils_is_json_object (priv->config, error)) {
g_prefix_error (error,
"%s.%s: ",