47 Commits

Author SHA1 Message Date
Rainer Gerhards
9bece39dc6
SQUASH
debug cleanup: remove some old, no longer used macros
2018-10-30 12:46:04 +01:00
PascalWithopf
c83e3ed216 correct codestyle in rsyslog part 2 2018-08-01 16:11:33 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
d542dd46da core: refactor mem free in legacy IP addr parsing function
also solves a memory leak which could only occur under out of
memory conditions

Potential leak detected by Coverity scan, CID 185369
2017-10-30 18:53:21 +01:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
16a22f9eff stringbuf refactor: interface change for cstrTrimTrailingWhiteSpace() 2016-05-19 11:09:24 +02:00
Rainer Gerhards
f8738727f9 change cstrFinalize() interface
the function can no longer fail and it is not expected that this
will ever happen again in the future. So we remove the return value,
giving a small speedup to the code.
2016-05-19 10:49:37 +02:00
Rainer Gerhards
bbc313a632 cleanup: remove superfluous condition checks 2015-12-09 11:55:40 +01:00
linmujia
6de1a8cf7f fix bugs of memory leak 2015-11-27 10:04:08 +08:00
Tomas Heinrich
ce54fd4a73 The AllowedSender directive misbehaved if network was down during startup
The passing of the AI_ADDRCONFIG flag to getaddrinfo() caused IP
prefixes to be interpreted as hostname wildcards if network was down
during rsyslog's startup.
2014-11-19 15:49:09 +01:00
Tomas Heinrich
e14a3d06f1 bugfix: plug a memleak in parsAddrWithBits()
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/runtime/net.c:876: alloc_arg: "parsAddrWithBits(rsParsObj *, struct NetAddr **, int *)" allocates memory that is stored into "uIP".
rsyslog-7.4.10/parse.c:419:2: alloc_fn: Storage is returned from allocation function "calloc(size_t, size_t)".
rsyslog-7.4.10/parse.c:419:2: var_assign: Assigning: "*pIP" = "calloc(1UL, 16UL)".
rsyslog-7.4.10/runtime/net.c:880: leaked_storage: Variable "uIP" going out of scope leaks the storage it points to.
2014-07-22 17:37:27 +02:00
Tomas Heinrich
b56df5725f bugfix: check return value of calloc() 2014-07-11 15:19:43 +02:00
Tomas Heinrich
2ce6f44c86 bugfix: prevent a double free
cstrConvSzStrAndDestruct() frees it's first argument but doesn't set
it to NULL as rsCStrDestruct() does. In couple of cases the code using
it assumed it does which could have led to double free.
This commit aligns the prototype of cstrConvSzStrAndDestruct() with
rsCStrDestruct(). The callers were updated for the new behavior and
several potential memleaks were plugged.

Error: USE_AFTER_FREE (CWE-825):
rsyslog-7.4.10/runtime/cfsysline.c:532: freed_arg: "cstrConvSzStrAndDestruct(cstr_t *, uchar **, int)" frees "pStrB".
rsyslog-7.4.10/runtime/stringbuf.c:486:2: freed_arg: "free(void *)" frees parameter "pThis".
rsyslog-7.4.10/runtime/cfsysline.c:553: deref_arg: Calling "rsCStrDestruct(cstr_t **)" dereferences freed pointer "pStrB".
rsyslog-7.4.10/runtime/stringbuf.c:216:16: var_assign_parm: Assigning: "pThis" = "*ppThis".
rsyslog-7.4.10/runtime/stringbuf.c:218:2: deref_var: Dereferencing "pThis" (which is a copy of "*ppThis").

Error: USE_AFTER_FREE (CWE-825):
rsyslog-7.4.10/outchannel.c:113: freed_arg: "cstrConvSzStrAndDestruct(cstr_t *, uchar **, int)" frees "pStrB".
rsyslog-7.4.10/runtime/stringbuf.c:486:2: freed_arg: "free(void *)" frees parameter "pThis".
rsyslog-7.4.10/outchannel.c:118: deref_arg: Calling "rsCStrDestruct(cstr_t **)" dereferences freed pointer "pStrB".
rsyslog-7.4.10/runtime/stringbuf.c:216:16: var_assign_parm: Assigning: "pThis" = "*ppThis".
rsyslog-7.4.10/runtime/stringbuf.c:218:2: deref_var: Dereferencing "pThis" (which is a copy of "*ppThis").

Error: USE_AFTER_FREE (CWE-825):
rsyslog-7.4.10/outchannel.c:181: freed_arg: "cstrConvSzStrAndDestruct(cstr_t *, uchar **, int)" frees "pStrB".
rsyslog-7.4.10/runtime/stringbuf.c:486:2: freed_arg: "free(void *)" frees parameter "pThis".
rsyslog-7.4.10/outchannel.c:186: deref_arg: Calling "rsCStrDestruct(cstr_t **)" dereferences freed pointer "pStrB".
rsyslog-7.4.10/runtime/stringbuf.c:216:16: var_assign_parm: Assigning: "pThis" = "*ppThis".
rsyslog-7.4.10/runtime/stringbuf.c:218:2: deref_var: Dereferencing "pThis" (which is a copy of "*ppThis").

Error: USE_AFTER_FREE (CWE-825):
rsyslog-7.4.10/template.c:480: freed_arg: "cstrConvSzStrAndDestruct(cstr_t *, uchar **, int)" frees "pStrB".
rsyslog-7.4.10/runtime/stringbuf.c:486:2: freed_arg: "free(void *)" frees parameter "pThis".
rsyslog-7.4.10/template.c:493: deref_arg: Calling "rsCStrDestruct(cstr_t **)" dereferences freed pointer "pStrB".
rsyslog-7.4.10/runtime/stringbuf.c:216:16: var_assign_parm: Assigning: "pThis" = "*ppThis".
rsyslog-7.4.10/runtime/stringbuf.c:218:2: deref_var: Dereferencing "pThis" (which is a copy of "*ppThis").
2014-07-11 15:19:43 +02:00
Rainer Gerhards
c0f5dd3fbf bugfix: potential segfault at startup with property-based filter
If the property name was followed by a space before the comma, rsyslogd
aborted on startup. Note that no segfault could happen if the initial
startup went well (this was a problem with the config parser).
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=381
2012-11-14 17:21:50 +01:00
Rainer Gerhards
6b5321bcdb cleanup: remove code for no-longer needed legacy conf functionality 2012-02-01 17:46:47 +01:00
Rainer Gerhards
ac9afc4149 Merge branch 'v5-stable' into master
Conflicts:
	ChangeLog
	action.h
	configure.ac
	doc/manual.html
	plugins/immark/immark.c
	plugins/impstats/impstats.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	runtime/cfsysline.c
	runtime/cfsysline.h
	runtime/conf.c
	runtime/ctok.c
	runtime/ctok.h
	runtime/ctok_token.c
	runtime/ctok_token.h
	runtime/dnscache.h
	runtime/expr.c
	runtime/expr.h
	runtime/rule.c
	runtime/rule.h
	runtime/ruleset.h
	runtime/sysvar.c
	runtime/vm.h
	runtime/vmop.c
	runtime/vmop.h
	runtime/vmprg.c
	runtime/vmprg.h
	runtime/vmstk.c
	runtime/vmstk.h
	tools/omusrmsg.c
2012-01-18 14:08:24 +01:00
Rainer Gerhards
0871d0a077 Merge branch 'v4-stable' into v5-stable
Conflicts:
	plugins/imfile/imfile.c
	plugins/omtesting/omtesting.c
	tcpsrv.c
	threads.c
2012-01-14 18:32:40 +01:00
Rainer Gerhards
0216053099 relicense parts under ASL 2.0
after carful check for copyright holder
2012-01-11 18:30:33 +01:00
Rainer Gerhards
e770177555 Merge branch 'v5-devel'
Conflicts:
	ChangeLog
2011-10-21 15:03:53 +02:00
Rainer Gerhards
10947b3f4a bugfix: missing whitespace after property-based filter was not detected 2011-10-21 14:05:59 +02:00
Rainer Gerhards
48877c8ef4 milestone: added support for CEE-properties in property-based filters 2010-12-01 17:28:36 +01:00
Rainer Gerhards
e04e1b5002 enhanced test environment (including testbench)
support for enhancing probability of memory addressing failure by
using non-NULL default value for malloced memory (optional, only if
requested by configure option). This helps to track down some
otherwise undetected issues within the testbench and is expected
to be very useful in the future.
2009-10-22 11:33:38 +02:00
Rainer Gerhards
d2d54013ae going forward in moving string-handling functions to new interface... 2009-06-17 15:22:13 +02:00
Rainer Gerhards
f7579e68a6 done various optimizations to the stringbuf and its users 2009-06-16 11:36:05 +02:00
Rainer Gerhards
8f8f65abb6 moved files to the runtime
there are still some files left which could go into the
runtime, but I think we will delete most of them once we
are done with the full modularization.
2008-04-16 10:26:54 +02:00
Rainer Gerhards
890f782323 some cleanup 2008-04-11 17:33:13 +02:00
Rainer Gerhards
5e279ea0f7 properties are now case-insensitive everywhere (script, filters, templates) 2008-04-03 09:31:55 +00:00
Rainer Gerhards
013073f1a6 changed rsCStrObj name to cstr_t, which is more inline with the rest of
rsyslog (now) and also much easier to type
2008-02-21 07:00:29 +00:00
Rainer Gerhards
c6bebca3c7 changed rsCStrDestruct() to use the new interface conventions 2008-02-20 14:02:33 +00:00
Rainer Gerhards
cd2b24dfc4 - added doc on how expressions will work
- cleaned up the stringbuf Construct interface
- did some cleanup on stringbuf calls - we now have much better interfaces
    and macros
2008-02-19 10:30:42 +00:00
Rainer Gerhards
5c686c8adc redesigned queue to utilize helper classes for threading support. This is
finally in a running state for regular (non disk-assisted) queues, with
    a minor nit at shutdown. So I can finally commit the work again to
    CVS...
2008-01-24 17:55:09 +00:00
Rainer Gerhards
004229dda6 changed license to GPLv3 (for what is to become rsyslog v3) 2007-12-14 11:21:57 +00:00
Rainer Gerhards
1c3baa7191 added Bartosz Kuzma patches for better compatibility with NetBSD - many
thanks for them!
2007-12-03 13:53:05 +00:00
Rainer Gerhards
82aeadce54 - changed part of the CStr interface so that better error tracking is
provided and the calling sequence is more intuitive (there were invalid
    calls based on a too-weired interface)
- (hopefully) fixed some remaining bugs rooted in wrong use of the CStr
    class. These could lead to program abort.
2007-09-05 15:59:47 +00:00
Rainer Gerhards
8f236abd49 fixed a memory leak in config file parsing thanks to varmojfekoj for the
patch
2007-07-23 13:07:30 +00:00
Rainer Gerhards
4a963e5f1f code cleanup (removed compiler warnings 2007-07-18 15:16:15 +00:00
Rainer Gerhards
4a4dbe2c38 fixed a bug that could case host wildcards to become corrupted 2007-07-18 10:11:15 +00:00
Rainer Gerhards
7822caa94a fully integrated patch from mildew@gmail.com 2007-07-16 13:11:06 +00:00
Rainer Gerhards
63e43e656a applied patch by mildew@gmail.com to support IPv6 in $AllowedSenders 2007-07-16 07:21:22 +00:00
Rainer Gerhards
3f08e1f726 moving towards autotools build system - config.h include forgotten & now
fixed
2007-07-11 10:53:58 +00:00
Rainer Gerhards
42b3a7a435 cleaned up some issues with $FileCreateMode 2007-07-04 10:23:53 +00:00
Rainer Gerhards
489a51be23 applied patch from Bartosz Kuzma to compile cleanly under NetBSD; changed a
number of char to unsigned char
2007-07-03 16:32:27 +00:00
Rainer Gerhards
4095554465 added allowedSender support for TCP 2005-09-27 12:25:11 +00:00
Rainer Gerhards
963ded1f45 nearing completion of allowedSenders functionality 2005-09-27 09:07:20 +00:00
Rainer Gerhards
6c2956163d added capability to filter on any property in selector lines 2005-09-19 15:52:43 +00:00
Rainer Gerhards
3e8ba29e5c added parsing of property-filter (but not complete property selector line
yet)
2005-09-19 10:29:24 +00:00
Rainer Gerhards
e34ca1e7d9 on the way to adding property-based filters - right before changing
cfline()
2005-09-15 15:05:11 +00:00