summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-08-08 16:44:48 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-08-08 16:44:48 +0200
commit615487401fd79c62ea42ad15ad3740995030ec5c (patch)
treef39e0150d06a32f8ce256bac53d021b9f25afebe
parent9b0697c03ccba29f5130509b2affe7ee5bbea2b3 (diff)
-fix nptr issues
-rw-r--r--src/datastore/datastore_api.c4
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c12
-rw-r--r--src/namestore/plugin_rest_namestore.c6
3 files changed, 14 insertions, 8 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index d658b9c85..a49bc8586 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -1400,7 +1400,7 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h,
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Asked to look for data of type %u under key `%s'\n",
(unsigned int) type,
- GNUNET_h2s (key));
+ (NULL != key) ? GNUNET_h2s (key) : "NULL");
if (NULL == key)
{
env = GNUNET_MQ_msg (gm,
@@ -1430,7 +1430,7 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h,
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Could not queue request for `%s'\n",
- GNUNET_h2s (key));
+ (NULL != key) ? GNUNET_h2s (key): "NULL");
return NULL;
}
#if INSANE_STATISTICS
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 847f7cb64..95d4c5878 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -185,15 +185,15 @@ do_shutdown (void *cls)
}
if (NULL != notfound_page)
{
- MHD_destroy_response (main_page->response);
- GNUNET_free (main_page->handle);
- GNUNET_free (main_page);
+ MHD_destroy_response (notfound_page->response);
+ GNUNET_free (notfound_page->handle);
+ GNUNET_free (notfound_page);
}
if (NULL != forbidden_page)
{
- MHD_destroy_response (main_page->response);
- GNUNET_free (main_page->handle);
- GNUNET_free (main_page);
+ MHD_destroy_response (forbidden_page->response);
+ GNUNET_free (forbidden_page->handle);
+ GNUNET_free (forbidden_page);
}
if (NULL != namestore)
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index ae93e5eff..ff5494dc7 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -955,6 +955,12 @@ list_ego (void *cls,
state = ID_REST_STATE_POST_INIT;
return;
}
+ if (NULL == ego)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Called with NULL ego\n");
+ return;
+ }
if (ID_REST_STATE_INIT == state)
{
ego_entry = GNUNET_new (struct EgoEntry);