From c8a6a25c5052c3debbac525a76e6bba5abf36ec7 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 21 Mar 2024 09:21:01 +0100 Subject: GNS: Fix null pointer use --- src/cli/gns/gnunet-gns.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cli/gns/gnunet-gns.c b/src/cli/gns/gnunet-gns.c index 19b3fc903..724fbce24 100644 --- a/src/cli/gns/gnunet-gns.c +++ b/src/cli/gns/gnunet-gns.c @@ -241,6 +241,7 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { + const char *effective_lookup_type; (void) cls; (void) args; (void) cfgfile; @@ -309,9 +310,15 @@ run (void *cls, GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); if (NULL != lookup_type) + { + effective_lookup_type = lookup_type; rtype = GNUNET_GNSRECORD_typename_to_number (lookup_type); + } else + { + effective_lookup_type = "A"; rtype = GNUNET_DNSPARSER_TYPE_A; + } if (UINT32_MAX == rtype) { fprintf (stderr, @@ -321,7 +328,7 @@ run (void *cls, if (! raw) { printf (">>> Looking for `%s' records under `%s'\n", - lookup_type, lookup_name); + effective_lookup_type, lookup_name); } lr = GNUNET_GNS_lookup_with_tld (gns, lookup_name, -- cgit v1.2.3