summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-04-30 22:36:08 +0200
committerThomas Haller <thaller@redhat.com>2022-05-16 16:34:31 +0200
commitcb2ab420a24a86ccc5efcdcbf9d4ae1c54a76ca7 (patch)
tree5ee0add70dc5aed4bd46f5cc0006f4f0f12029cc
parent668d8050a50d20a1497042cc19d2400fdd0035d9 (diff)
downloadNetworkManager-cb2ab420a24a86ccc5efcdcbf9d4ae1c54a76ca7.tar.gz
dhcp: don't assert against untrusted data in maybe_add_option()
-rw-r--r--src/core/dhcp/nm-dhcp-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c
index 52a46b6633..888dc3f4e8 100644
--- a/src/core/dhcp/nm-dhcp-client.c
+++ b/src/core/dhcp/nm-dhcp-client.c
@@ -814,7 +814,8 @@ maybe_add_option(NMDhcpClient *self, GHashTable *hash, const char *key, GVariant
{
char *str_value = NULL;
- g_return_if_fail(g_variant_is_of_type(value, G_VARIANT_TYPE_BYTESTRING));
+ if (!g_variant_is_of_type(value, G_VARIANT_TYPE_BYTESTRING))
+ return;
if (g_str_has_prefix(key, OLD_TAG))
return;