gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: -fix coverity


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: -fix coverity
Date: Wed, 29 Mar 2017 14:21:38 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 2b87f173e -fix coverity
2b87f173e is described below

commit 2b87f173e360aaf4a3bac3fbc6e5b4dc44cf58cd
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Wed Mar 29 14:21:30 2017 +0200

    -fix coverity
---
 src/gns/plugin_rest_gns.c                                |  1 +
 src/identity-provider/gnunet-service-identity-provider.c |  1 +
 src/identity-provider/plugin_rest_identity_provider.c    |  3 +++
 src/namestore/plugin_rest_namestore.c                    | 11 ++++++-----
 4 files changed, 11 insertions(+), 5 deletions(-)

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)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]