[glib/pgriffis/wip/resolver-https] fixup! gresolver: Add support for the HTTPS DNS type
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/pgriffis/wip/resolver-https] fixup! gresolver: Add support for the HTTPS DNS type
- Date: Tue, 8 Jun 2021 15:14:15 +0000 (UTC)
commit 057260802340b6286bf0ecad2fe044da099639fd
Author: Patrick Griffis <pgriffis igalia com>
Date: Tue Jun 8 10:13:59 2021 -0500
fixup! gresolver: Add support for the HTTPS DNS type
gio/gthreadedresolver.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
index f89cf84a2..0b498d4ac 100644
--- a/gio/gthreadedresolver.c
+++ b/gio/gthreadedresolver.c
@@ -893,15 +893,14 @@ parse_res_https (guchar *answer,
GETSHORT (value_length, *p);
if (value_length > (gsize) (end - *p))
- {
- *p = end;
- break;
- }
+ goto invalid_input;
key_str = svcb_key_to_string (key);
- if (get_svcb_value (key, value_length, *p, end, &value))
- g_variant_builder_add (¶ms_builder, "{sv}", key_str, value);
+ if (!get_svcb_value (key, value_length, *p, end, &value))
+ goto invalid_input;
+
+ g_variant_builder_add (¶ms_builder, "{sv}", key_str, value);
*p += value_length;
g_free (key_str);
@@ -911,6 +910,12 @@ parse_res_https (guchar *answer,
variant = g_variant_new ("(qsa{sv})", priority, target, ¶ms_builder);
g_free (target);
return variant;
+
+invalid_input:
+ g_debug ("Invalid response for DNS HTTPS request, ignoring a record");
+ *p = end;
+ g_free (target);
+ return NULL;
}
static gint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]