From ad922a36f5c5f92568055062b88d569928a27834 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Mon, 28 May 2007 12:46:38 +0000 Subject: Patches from Marius Tomaschewski : - Fixed sigterm_handler to close logfile and then call output_plugin->fini. The output_plugin->fini function may still use the logger (e.g. sqlite3 does), what causes a SEGV (really happens in case of sqlite3 db init error - as far as I remember) - Changed sighup_handler_print to not to call exit(2) on reopen failure, but try to reopen and fallback to continue using old descriptor on failure. - Fixed mac output in ulogd_BASE.c - Added explicit termination of the hostname buffer: "[...] if namelen is an insufficient length to hold the host name, then the returned name is truncated and it is unspecified whether the returned name is null-terminated. [...]" as SUSv2 specifies. - Added to print "\n" after ULOGD_RET_NONE type as well after an unspecified type. See example above at extensions/ulogd_BASE.c. - Fixed to set the '\0' at the end and not behind the buffer. --- ulogd/extensions/ulogd_PWSNIFF.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ulogd/extensions/ulogd_PWSNIFF.c') diff --git a/ulogd/extensions/ulogd_PWSNIFF.c b/ulogd/extensions/ulogd_PWSNIFF.c index 1f86bbe..d205cdd 100644 --- a/ulogd/extensions/ulogd_PWSNIFF.c +++ b/ulogd/extensions/ulogd_PWSNIFF.c @@ -116,7 +116,7 @@ static ulog_iret_t *_interp_pwsniff(ulog_interpreter_t *ip, ulog_packet_msg_t *p return NULL; } strncpy(ret[0].value.ptr, (char *)begp, len); - *((char *)ret[0].value.ptr + len + 1) = '\0'; + *((char *)ret[0].value.ptr + len) = '\0'; } if (pw_len) { ret[1].value.ptr = (char *) malloc(pw_len+1); @@ -126,7 +126,7 @@ static ulog_iret_t *_interp_pwsniff(ulog_interpreter_t *ip, ulog_packet_msg_t *p return NULL; } strncpy(ret[1].value.ptr, (char *)pw_begp, pw_len); - *((char *)ret[1].value.ptr + pw_len + 1) = '\0'; + *((char *)ret[1].value.ptr + pw_len) = '\0'; } return ret; -- cgit v1.2.3