[icinga-checkins] icinga.org: icinga-core/dev/ido: fix unsafe null ptr passed to debug log, segfault on solaris #2271

git at icinga.org git at icinga.org
Mon Feb 6 15:54:49 CET 2012


Module: icinga-core
Branch: dev/ido
Commit: d8dd9b13e613095fcee7c528668ae6f602879af1
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=d8dd9b13e613095fcee7c528668ae6f602879af1

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Mon Jan 16 13:40:53 2012 +0100

fix unsafe null ptr passed to debug log, segfault on solaris #2271

refs #2271

---

 module/idoutils/src/ido2db.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/module/idoutils/src/ido2db.c b/module/idoutils/src/ido2db.c
index eccb860..f95e7a9 100644
--- a/module/idoutils/src/ido2db.c
+++ b/module/idoutils/src/ido2db.c
@@ -1517,7 +1517,7 @@ int ido2db_handle_client_input(ido2db_idi *idi, char *buf) {
 	int data_type = IDO_DATA_NONE;
 	int input_type = IDO2DB_INPUT_DATA_NONE;
 
-	ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_handle_client_input(instance_name=%s) start\n", idi->instance_name);
+	ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_handle_client_input start\n");
 
 #ifdef DEBUG_IDO2DB2
 	printf("HANDLING: '%s'\n", buf);
@@ -1526,6 +1526,8 @@ int ido2db_handle_client_input(ido2db_idi *idi, char *buf) {
 	if (buf == NULL || idi == NULL)
 		return IDO_ERROR;
 
+	ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_handle_client_input instance_name=%s\n", (idi->instance_name == NULL) ? "(null)" : idi->instance_name);
+
 	/* we're ignoring client data because of wrong protocol version, etc...  */
 	if (idi->ignore_client_data == IDO_TRUE)
 		return IDO_ERROR;





More information about the icinga-checkins mailing list