aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2024-03-21 09:21:01 +0100
committert3serakt <t3ss@posteo.de>2024-04-10 20:14:57 +0200
commitc8a6a25c5052c3debbac525a76e6bba5abf36ec7 (patch)
treecdc48294ca5a5624bb0b9a4d299c3db41bc2b596
parentf981dd7019dafd901c8484724427f74498af9477 (diff)
downloadgnunet-c8a6a25c5052c3debbac525a76e6bba5abf36ec7.tar.gz
gnunet-c8a6a25c5052c3debbac525a76e6bba5abf36ec7.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,