[icinga-checkins] icinga.org: icinga-core/master: fixed: submitting non existent host/ service on avail.cgi causes segfault. #1700

git at icinga.org git at icinga.org
Mon Jul 11 21:16:50 CEST 2011


Module: icinga-core
Branch: master
Commit: 2b7ae1766486ed138d8123df7de33f798f94c924
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=2b7ae1766486ed138d8123df7de33f798f94c924

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Tue Jul  5 21:36:52 2011 +0200

fixed: submitting non existent host/service on avail.cgi causes segfault. #1700

fixes: #1700

---

 Changelog   |    1 +
 cgi/avail.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 5c86f9a..86cc11a 100644
--- a/Changelog
+++ b/Changelog
@@ -34,6 +34,7 @@ FIXES
 * classic ui: remove sidebar.html inclusion in index.html causing troubles on reload #1632
 * classic ui: fixed: User can execute host/servicegroup commands even if not authorized for (Sven Nierlein) #1679
 * classic ui: fixed: plugin_output_short didn't get checked properly and caused segfault in status.cgi #1673
+* classic ui: fixed: submitting non existent host/service on avail.cgi causes segfault. (M. Luebben) #1700
 
 * install: fix event handlers cmd file location in contrib #1501
 * install: fix make install-idoutils overwrites sample - adding idoutils.cfg-sample instead #1625
diff --git a/cgi/avail.c b/cgi/avail.c
index c2b29ee..37689ef 100644
--- a/cgi/avail.c
+++ b/cgi/avail.c
@@ -440,13 +440,13 @@ int main(int argc, char **argv){
 				if(show_all_hosts==TRUE)
 					printf("All Hosts");
 				else
-					printf("Host '%s'",(temp_host->display_name!=NULL)?temp_host->display_name:temp_host->name);
+					printf("Host '%s'",(temp_host!=NULL && temp_host->display_name!=NULL)?temp_host->display_name:host_name);
 			        }
 			else if(display_type==DISPLAY_SERVICE_AVAIL){
 				if(show_all_services==TRUE)
 					printf("All Services");
 				else
-					printf("Service '%s' On Host '%s'",(temp_service->display_name!=NULL)?temp_service->display_name:temp_service->description,(temp_host->display_name!=NULL)?temp_host->display_name:temp_host->name);
+					printf("Service '%s' On Host '%s'",(temp_service!=NULL && temp_service->display_name!=NULL)?temp_service->display_name:service_desc,(temp_host!=NULL && temp_host->display_name!=NULL)?temp_host->display_name:host_name);
 		                }
 			else if(display_type==DISPLAY_HOSTGROUP_AVAIL){
 				if(show_all_hostgroups==TRUE)





More information about the icinga-checkins mailing list