aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2024-03-21 09:21:01 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2024-03-21 09:21:08 +0100
commit2aded5e3abe303338687656cb248819b62ee27f0 (patch)
tree04383983c073b2f7a9fd13e98ff61c0eec08f146
parent27e952497f4b03afaead016ec4fb71371efefc26 (diff)
downloadgnunet-2aded5e3abe303338687656cb248819b62ee27f0.tar.gz
gnunet-2aded5e3abe303338687656cb248819b62ee27f0.zip
GNS: Fix null pointer use
-rw-r--r--src/cli/gns/gnunet-gns.c9
1 files changed, 8 insertions, 1 deletions
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,
241 const char *cfgfile, 241 const char *cfgfile,
242 const struct GNUNET_CONFIGURATION_Handle *c) 242 const struct GNUNET_CONFIGURATION_Handle *c)
243{ 243{
244 const char *effective_lookup_type;
244 (void) cls; 245 (void) cls;
245 (void) args; 246 (void) args;
246 (void) cfgfile; 247 (void) cfgfile;
@@ -309,9 +310,15 @@ run (void *cls,
309 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, 310 GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
310 NULL); 311 NULL);
311 if (NULL != lookup_type) 312 if (NULL != lookup_type)
313 {
314 effective_lookup_type = lookup_type;
312 rtype = GNUNET_GNSRECORD_typename_to_number (lookup_type); 315 rtype = GNUNET_GNSRECORD_typename_to_number (lookup_type);
316 }
313 else 317 else
318 {
319 effective_lookup_type = "A";
314 rtype = GNUNET_DNSPARSER_TYPE_A; 320 rtype = GNUNET_DNSPARSER_TYPE_A;
321 }
315 if (UINT32_MAX == rtype) 322 if (UINT32_MAX == rtype)
316 { 323 {
317 fprintf (stderr, 324 fprintf (stderr,
@@ -321,7 +328,7 @@ run (void *cls,
321 if (! raw) 328 if (! raw)
322 { 329 {
323 printf (">>> Looking for `%s' records under `%s'\n", 330 printf (">>> Looking for `%s' records under `%s'\n",
324 lookup_type, lookup_name); 331 effective_lookup_type, lookup_name);
325 } 332 }
326 lr = GNUNET_GNS_lookup_with_tld (gns, 333 lr = GNUNET_GNS_lookup_with_tld (gns,
327 lookup_name, 334 lookup_name,