Skip to content

Commit

Permalink
[Backport] Fix segmentation fault if contact has no mail or alias
Browse files Browse the repository at this point in the history
  • Loading branch information
nook24 committed Feb 15, 2018
1 parent 8c9381f commit a94d0e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions statusengine/src/statusengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ int nebmodule_init(int flags, char *args, nebmodule *handle){
neb_set_module_info(statusengine_module_handle, NEBMODULE_MODINFO_TITLE, "Statusengine - the missing event broker");
neb_set_module_info(statusengine_module_handle, NEBMODULE_MODINFO_AUTHOR, "Daniel Ziegler");
neb_set_module_info(statusengine_module_handle, NEBMODULE_MODINFO_TITLE, "Copyright (c) 2014 - present Daniel Ziegler");
neb_set_module_info(statusengine_module_handle, NEBMODULE_MODINFO_VERSION, "2.0.6");
neb_set_module_info(statusengine_module_handle, NEBMODULE_MODINFO_VERSION, "2.0.7");
neb_set_module_info(statusengine_module_handle, NEBMODULE_MODINFO_LICENSE, "GPL v2");
neb_set_module_info(statusengine_module_handle, NEBMODULE_MODINFO_DESC, "A powerful and flexible event broker");

Expand Down Expand Up @@ -1605,8 +1605,8 @@ void dump_object_data(){
my_object = json_object_new_object();
json_object_object_add(my_object, "object_type", json_object_new_int(10));
json_object_object_add(my_object, "name", json_object_new_string(temp_contact->name));
json_object_object_add(my_object, "alias", json_object_new_string(temp_contact->alias));
json_object_object_add(my_object, "email", json_object_new_string(temp_contact->email));
json_object_object_add(my_object, "alias", (temp_contact->alias != NULL ? json_object_new_string(temp_contact->alias) : NULL));
json_object_object_add(my_object, "email", (temp_contact->email != NULL ? json_object_new_string(temp_contact->email) : NULL));
json_object_object_add(my_object, "pager", (temp_contact->pager != NULL ? json_object_new_string(temp_contact->pager) : NULL));
json_object_object_add(my_object, "host_notification_period", json_object_new_string(temp_contact->host_notification_period));
json_object_object_add(my_object, "service_notification_period", json_object_new_string(temp_contact->service_notification_period));
Expand Down

0 comments on commit a94d0e4

Please sign in to comment.