From 49e667d250ca4e5ba9cb9c93c467c6196d16601c Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Wed, 15 Dec 2021 16:53:41 +0000 Subject: [PATCH] gthreadedresolver: Export g_resolver_records_from_res_query() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While it’s not a supported public part of the API, exporting this symbol from the library means we can easily test the DNS record parser, which is important to do since it handles untrusted data from the network. --- gio/gthreadedresolver.c | 2 +- gio/gthreadedresolver.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c index 93794b5b3..1a339ecf1 100644 --- a/gio/gthreadedresolver.c +++ b/gio/gthreadedresolver.c @@ -652,7 +652,7 @@ g_resolver_record_type_to_rrtype (GResolverRecordType type) g_return_val_if_reached (-1); } -static GList * +GList * g_resolver_records_from_res_query (const gchar *rrname, gint rrtype, guchar *answer, diff --git a/gio/gthreadedresolver.h b/gio/gthreadedresolver.h index 5900d6a14..9b0f98222 100644 --- a/gio/gthreadedresolver.h +++ b/gio/gthreadedresolver.h @@ -42,6 +42,15 @@ typedef struct { GLIB_AVAILABLE_IN_ALL GType g_threaded_resolver_get_type (void) G_GNUC_CONST; +/* Used for a private test API */ +GLIB_AVAILABLE_IN_ALL +GList *g_resolver_records_from_res_query (const gchar *rrname, + gint rrtype, + guchar *answer, + gint len, + gint herr, + GError **error); + G_END_DECLS #endif /* __G_RESOLVER_H__ */