[icinga-checkins] icinga.org: icinga-core/r1.5: fix segfault when sending host notifications #1703

git at icinga.org git at icinga.org
Tue Jul 12 20:09:40 CEST 2011


Module: icinga-core
Branch: r1.5
Commit: 8b035e4c70ef532750680e3f35319121091ef049
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=8b035e4c70ef532750680e3f35319121091ef049

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Tue Jul 12 19:56:06 2011 +0200

fix segfault when sending host notifications #1703

sourced from #1653, missing memory allocation when issueing
a free on the mac struct.

gdb run and sending custom host notifications reveiled the error.
fixed and running again.

fixes #1703

---

 base/notifications.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/base/notifications.c b/base/notifications.c
index 57ea817..b13d8fe 100644
--- a/base/notifications.c
+++ b/base/notifications.c
@@ -1230,6 +1230,9 @@ int host_notification(host *hst, int type, char *not_author, char *not_data, int
 		return OK;
 	        }
 
+	/* allocate memory for local mac */
+	memset(&mac, 0, sizeof(mac));
+
 	/* clear volatile macros */
 	clear_volatile_macros_r(&mac);
 





More information about the icinga-checkins mailing list