From: Schanzenbach, Martin Date: Wed, 29 Mar 2017 12:21:30 +0000 (+0200) Subject: -fix coverity X-Git-Tag: gnunet-0.11.0rc0~279^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2b87f173e360aaf4a3bac3fbc6e5b4dc44cf58cd;p=oweals%2Fgnunet.git -fix coverity --- diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c index 5d4734d9a..b7775e4ea 100644 --- a/src/gns/plugin_rest_gns.c +++ b/src/gns/plugin_rest_gns.c @@ -529,6 +529,7 @@ get_gns_cont (struct GNUNET_REST_RequestHandle *conndata_handle, { handle->pkey_str = GNUNET_CONTAINER_multihashmap_get (conndata_handle->url_param_map, &key); + GNUNET_assert (NULL != handle->pkey_str); if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_public_key_from_string (handle->pkey_str, strlen(handle->pkey_str), diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c index 17c288368..53fd02c9f 100644 --- a/src/identity-provider/gnunet-service-identity-provider.c +++ b/src/identity-provider/gnunet-service-identity-provider.c @@ -442,6 +442,7 @@ handle_token_update (void *cls) { cur_value = GNUNET_CONTAINER_multihashmap_get (ego_entry->attr_map, &key_hash); + GNUNET_assert (NULL != cur_value); GNUNET_CONTAINER_DLL_insert (new_token->attr_head, new_token->attr_tail, cur_value); diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/identity-provider/plugin_rest_identity_provider.c index e03f502ad..907b28ba9 100644 --- a/src/identity-provider/plugin_rest_identity_provider.c +++ b/src/identity-provider/plugin_rest_identity_provider.c @@ -580,6 +580,7 @@ issue_token_cont (struct GNUNET_REST_RequestHandle *con, } nonce_str = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map, &key); + GNUNET_assert (NULL != nonce_str); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Request nonce: %s\n", nonce_str); @@ -794,6 +795,7 @@ list_token_cont (struct GNUNET_REST_RequestHandle *con_handle, } ego_val = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map, &key); + GNUNET_assert (NULL != ego_val); //Remove non-matching egos for (ego_entry = handle->ego_head; NULL != ego_entry;) @@ -866,6 +868,7 @@ exchange_cont (void *cls, } nonce_str = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map, &key); + GNUNET_assert (NULL != nonce_str); GNUNET_assert (1 == sscanf (nonce_str, "%"SCNu64, &expected_nonce)); if (ticket_nonce != expected_nonce) diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c index 0d36cf445..50957a5b4 100644 --- a/src/namestore/plugin_rest_namestore.c +++ b/src/namestore/plugin_rest_namestore.c @@ -899,10 +899,11 @@ namestore_zkey_cont (struct GNUNET_REST_RequestHandle *con, } handle->zkey_str = GNUNET_CONTAINER_multihashmap_get (handle->rest_handle->url_param_map, &key); - if (GNUNET_OK != - GNUNET_CRYPTO_ecdsa_public_key_from_string (handle->zkey_str, + if ((NULL == handle->zkey_str) || + (GNUNET_OK != + GNUNET_CRYPTO_ecdsa_public_key_from_string (handle->zkey_str, strlen (handle->zkey_str), - &pubkey)) + &pubkey))) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Zkey invalid %s\n", handle->zkey_str); @@ -1126,8 +1127,8 @@ rest_identity_process_request(struct GNUNET_REST_RequestHandle *rest_handle, { type = GNUNET_CONTAINER_multihashmap_get (handle->rest_handle->url_param_map, &key); - - handle->type = GNUNET_GNSRECORD_typename_to_number (type); + if (NULL != type) + handle->type = GNUNET_GNSRECORD_typename_to_number (type); } name = get_name_from_url (handle->url); if (NULL != ego)