aboutsummaryrefslogtreecommitdiff
path: root/src/identity/plugin_rest_identity.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-05 20:11:18 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-05 20:11:18 +0100
commitec9269fd94cda7b2195dcbe754eda053288478b7 (patch)
tree9aa0d0b3d4131f1198b8b31da9f879e7bafec8b5 /src/identity/plugin_rest_identity.c
parent7cad4a8604812fcea3178a6a6cb411b0237776ca (diff)
downloadgnunet-ec9269fd94cda7b2195dcbe754eda053288478b7.tar.gz
gnunet-ec9269fd94cda7b2195dcbe754eda053288478b7.zip
-fix possible npe
Diffstat (limited to 'src/identity/plugin_rest_identity.c')
-rw-r--r--src/identity/plugin_rest_identity.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index 5f34d0f1b..33804143d 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -593,6 +593,7 @@ ego_edit_cont (struct GNUNET_REST_RequestHandle *con,
593 struct GNUNET_JSONAPI_Resource *json_res; 593 struct GNUNET_JSONAPI_Resource *json_res;
594 struct RequestHandle *handle = cls; 594 struct RequestHandle *handle = cls;
595 struct EgoEntry *ego_entry; 595 struct EgoEntry *ego_entry;
596 struct EgoEntry *ego_entry_tmp;
596 struct MHD_Response *resp; 597 struct MHD_Response *resp;
597 json_t *subsys_json; 598 json_t *subsys_json;
598 json_t *name_json; 599 json_t *name_json;
@@ -684,12 +685,12 @@ ego_edit_cont (struct GNUNET_REST_RequestHandle *con,
684 if ((NULL != name_json) && json_is_string (name_json)) 685 if ((NULL != name_json) && json_is_string (name_json))
685 { 686 {
686 newname = json_string_value (name_json); 687 newname = json_string_value (name_json);
687 for (ego_entry = handle->ego_head; 688 for (ego_entry_tmp = handle->ego_head;
688 NULL != ego_entry; 689 NULL != ego_entry_tmp;
689 ego_entry = ego_entry->next) 690 ego_entry_tmp = ego_entry_tmp->next)
690 { 691 {
691 if (0 == strcasecmp (newname, ego_entry->identifier) && 692 if (0 == strcasecmp (newname, ego_entry_tmp->identifier) &&
692 0 != strcasecmp (keystring, ego_entry->keystring)) 693 0 != strcasecmp (keystring, ego_entry_tmp->keystring))
693 { 694 {
694 //Ego with same name not allowed 695 //Ego with same name not allowed
695 GNUNET_JSONAPI_document_delete (json_obj); 696 GNUNET_JSONAPI_document_delete (json_obj);