dhcp: don't assert against untrusted data in maybe_add_option()

This commit is contained in:
Thomas Haller 2022-04-30 22:36:08 +02:00
parent 668d8050a5
commit cb2ab420a2
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;