7681 Commits

Author SHA1 Message Date
Rainer Gerhards
aa38f64bb3 Merge branch 'v7-stable' into v8-stable 2014-07-15 08:39:56 +02:00
Rainer Gerhards
cf01379662 testbench: do no longer rely in some text on specific hostname 2014-07-14 19:01:32 +02:00
Rainer Gerhards
44672374ad Merge branch 'v8-stable' 2014-07-14 15:48:09 +02:00
Rainer Gerhards
4b8a2267b4 testbench: some tests had inappropriate configs
which could lead to *correct* message loss on slow or heavily
loaded systems
2014-07-14 15:47:40 +02:00
Rainer Gerhards
15cabb1b6f testbench: some tests had inappropriate configs
which could lead to *correct* message loss on slow or heavily
loaded systems
2014-07-14 15:46:30 +02:00
Rainer Gerhards
f1d00f3c91 Merge branch 'v8-stable'
Conflicts:
	ChangeLog
	grammar/lexer.l
2014-07-14 14:58:27 +02:00
Rainer Gerhards
278a2c8357 Merge branch 'v8-stable' of https://github.com/rsyslog/rsyslog into v8-stable 2014-07-14 14:50:16 +02:00
Rainer Gerhards
4afd000982 nitfixes 2014-07-14 14:38:15 +02:00
Rainer Gerhards
d4de83d846 testbench: make extended mysql test a bit more elaborate 2014-07-14 14:23:25 +02:00
Rainer Gerhards
bae2cf3cce Merge branch 'v8-stable' 2014-07-14 11:39:27 +02:00
Rainer Gerhards
5a80893186 Merge branch 'v8-stable' of git+ssh://git.adiscon.com/git/rsyslog into v8-stable 2014-07-14 11:39:06 +02:00
Rainer Gerhards
380b3b3bcf testbench: adjust test to new config param defaults
The test didn't make sense with the new defaults, as the disk queue
was never activated. While at it, also improved test output a bit.
2014-07-14 11:38:16 +02:00
Rainer Gerhards
f81cdc257e testbench: add -m option to chkseq
This permits to check files with a limited number of missing messages
2014-07-14 11:21:58 +02:00
Rainer Gerhards
10a055ddaa fix: remove accidently left-in debug output (in previous commit) 2014-07-13 15:36:44 +02:00
Rainer Gerhards
085928dac2 Merge branch 'v7-stable' into v8-stable 2014-07-13 15:31:35 +02:00
Rainer Gerhards
674e2aec3d regression fix: invalid ptr was passed
happend by merging patches this morning, never released
2014-07-13 14:57:32 +02:00
Rainer Gerhards
eb89f4ddba Merge branch 'v8-stable' 2014-07-13 13:07:19 +02:00
Rainer Gerhards
c2c8c26c87 Merge branch 'v7-stable' into v8-stable
Conflicts:
	plugins/imfile/imfile.c
2014-07-13 13:07:08 +02:00
Rainer Gerhards
14fef23001 Merge branch 'v7-stable' of git+ssh://git.adiscon.com/git/rsyslog into v7-stable 2014-07-13 13:01:02 +02:00
Rainer Gerhards
bb0a0352e6 Merge remote-tracking branch 'github/v7-stable-th-coverity' into v7-stable 2014-07-13 13:00:51 +02:00
Rainer Gerhards
6d668c915f cosmetic: fix some gcc --pedantic messages 2014-07-13 12:43:07 +02:00
Rainer Gerhards
a45ea8a144 testbench: make more reliable shutdown
so far, we checked only the main queue size to become zero, ignoring
the sizes of action queues. For some tests, this caused racieness and
unreliability. Now, we check all queues. This should make matters
much more stable.
2014-07-11 17:23:21 +02:00
Rainer Gerhards
244ca62e33 Merge branch 'v8-stable' 2014-07-11 15:32:54 +02:00
Rainer Gerhards
bb48b34db0 Merge branch 'v7-stable' into v8-stable 2014-07-11 15:32:45 +02:00
Rainer Gerhards
c3db2ef98d add --enable-generate-man-pages configure switch (default: enabled)
This forces generation of man pages, even if cached ones exists. This
"fixes" a typical release tarball nit. While it is hackish, the
benefit is clear given the history of failed tarball releases since
we changed the cached man page handling. It was just too easy to get
that wrong.
2014-07-11 15:32:10 +02:00
Tomas Heinrich
c3caf0f4f6 bugfix: plug a memleak in imudp
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imudp/imudp.c:413: alloc_arg: "msgConstructWithTime(msg_t **, struct syslogTime *, time_t)" allocates memory that is stored into "pMsg".
rsyslog-7.4.10/runtime/msg.c:745:2: alloc_arg: "msgBaseConstruct(msg_t **)" allocates memory that is stored into "*ppThis".
rsyslog-7.4.10/runtime/msg.c:674:2: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/runtime/msg.c:674:2: var_assign: Assigning: "pM" = "malloc(576UL)".
rsyslog-7.4.10/runtime/msg.c:725:2: var_assign: Assigning: "*ppThis" = "pM".
rsyslog-7.4.10/plugins/imudp/imudp.c:414: noescape: Resource "pMsg" is not freed or pointed-to in function "MsgSetRawMsg(msg_t *, char *, size_t)".
rsyslog-7.4.10/runtime/msg.c:2403:26: noescape: "MsgSetRawMsg(msg_t *, char *, size_t)" does not free or save its pointer parameter "pThis".
rsyslog-7.4.10/plugins/imudp/imudp.c:415: noescape: Resource "pMsg" is not freed or pointed-to in function "MsgSetInputName(msg_t *, prop_t *)".
rsyslog-7.4.10/runtime/msg.c:2208:29: noescape: "MsgSetInputName(msg_t *, prop_t *)" does not free or save its pointer parameter "pThis".
rsyslog-7.4.10/plugins/imudp/imudp.c:416: noescape: Resource "pMsg" is not freed or pointed-to in function "MsgSetRuleset(msg_t *, ruleset_t *)".
rsyslog-7.4.10/runtime/msg.c:1921:27: noescape: "MsgSetRuleset(msg_t *, ruleset_t *)" does not free or save its pointer parameter "pMsg".
rsyslog-7.4.10/plugins/imudp/imudp.c:417: noescape: Resource "pMsg" is not freed or pointed-to in function "MsgSetFlowControlType(msg_t *, flowControl_t)".
rsyslog-7.4.10/runtime/msg.c:1755:30: noescape: "MsgSetFlowControlType(msg_t *, flowControl_t)" does not free or save its pointer parameter "pMsg".
rsyslog-7.4.10/plugins/imudp/imudp.c:421: noescape: Resource "pMsg" is not freed or pointed-to in function "msgSetFromSockinfo(msg_t *, struct sockaddr_storage *)".
rsyslog-7.4.10/runtime/msg.c:2229:27: noescape: "msgSetFromSockinfo(msg_t *, struct sockaddr_storage *)" does not free or save its pointer parameter "pThis".
rsyslog-7.4.10/plugins/imudp/imudp.c:436: leaked_storage: Variable "pMsg" going out of scope leaks the storage it points to.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
fd25f5e04c bugfix: add a missing cleanup in case of an error
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imudp/imudp.c:260: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/plugins/imudp/imudp.c:260: var_assign: Assigning: "newlcnfinfo" = storage returned from "malloc(56UL)".
rsyslog-7.4.10/plugins/imudp/imudp.c:307: leaked_storage: Variable "newlcnfinfo" going out of scope leaks the storage it points to.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
f12d0c599f bugfix: prevent leaking a socket in case of an error
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1252: open_arg: "AcceptConnReq(ptcplstn_t *, int *, prop_t **, prop_t **)" opens handle stored into "newSock".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:615:2: open_fn: Returning handle opened by function "accept(int, __SOCKADDR_ARG, socklen_t * restrict)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:615:2: var_assign: Assigning: "iNewSock" = "accept(pLstn->sock, __SOCKADDR_ARG({ .__sockaddr__ = (struct sockaddr *)&addr}), &addrlen)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:623:3: noescape: Resource "iNewSock" is not freed or pointed-to in function "EnableKeepAlive(ptcplstn_t *, int)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:535:40: noescape: "EnableKeepAlive(ptcplstn_t *, int)" does not free or save its handle parameter "sock".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:629:2: noescape: Resource "iNewSock" is not freed or pointed-to in function "fcntl(int, int, ...)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:634:3: noescape: Resource "iNewSock" is not freed or pointed-to in function "fcntl(int, int, ...)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:641:2: var_assign: Assigning: "*newSock" = "iNewSock".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1260: leaked_handle: Handle variable "newSock" going out of scope leaks the handle.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
b4329a2c23 bugfix: plug more memleaks in imptcp
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1120: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1120: var_assign: Assigning: "pSrv" = storage returned from "malloc(136UL)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1159: leaked_storage: Variable "pSrv" going out of scope leaks the storage it points to.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
e4d0e1b8e4 bugfix: plug more memleaks in imptcp 2014-07-11 15:19:44 +02:00
Tomas Heinrich
6d1eab822a bugfix: don't add session to the server upon failure
The session should be added after everything else is completed.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
88c9c3054f bugfix: plug more memleaks in imptcp
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imptcp/imptcp.c:964: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:964: var_assign: Assigning: "pSess" = storage returned from "malloc(88UL)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:987: leaked_storage: Variable "pSess" going out of scope leaks the storage it points to.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
106d19ae53 bugfix: don't add listener to the server upon failure
The listener should be added after everything else is completed.
2014-07-11 15:19:43 +02:00
Tomas Heinrich
d372830d87 bugfix: plug memleaks in imptcp
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imptcp/imptcp.c:925: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:925: var_assign: Assigning: "pLstn" = storage returned from "malloc(56UL)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:951: leaked_storage: Variable "pLstn" going out of scope leaks the storage it points to.
2014-07-11 15:19:43 +02:00
Tomas Heinrich
a6c4e18780 bugfix: propagate an error code
Previously, the return value was lost as iRet is overwritten in
CHKiRet(). The error code is not handled currently thus the utility is
disputable.
2014-07-11 15:19:43 +02:00
Tomas Heinrich
6d6564f1fd bugfix: add a missing pointer assignment 2014-07-11 15:19:43 +02:00
Tomas Heinrich
226b45feb0 bugfix: remove redundant return 2014-07-11 15:19:43 +02:00
Tomas Heinrich
3b9be747b9 bugfix: plug a memleak 2014-07-11 15:19:43 +02:00
Tomas Heinrich
f0a8468cf5 bugfix: check return value of ratelimitNew() 2014-07-11 15:19:43 +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
Tomas Heinrich
5d48f71eb6 bugfix: check return value of malloc() 2014-07-11 15:19:43 +02:00
Tomas Heinrich
3cfde761f6 bugfix: check return value of calloc() 2014-07-11 15:19:43 +02:00
Tomas Heinrich
1c14e33c2b bugfix: check array bounds 2014-07-11 15:19:43 +02:00
Rainer Gerhards
d5de1f4a67 prepare for 8.3.4 v8.3.4 2014-07-11 15:19:23 +02:00
Rainer Gerhards
57202f1341 Merge branch 'v8-stable' 2014-07-11 12:56:29 +02:00
Rainer Gerhards
0439592567 Merge branch 'v7-stable' into v8-stable 2014-07-11 12:56:21 +02:00
Rainer Gerhards
e61d8a88d0 Merge branch 'v7-stable' of git+ssh://git.adiscon.com/git/rsyslog into v7-stable 2014-07-11 12:47:23 +02:00
Rainer Gerhards
df2d8de8c4 fix inconsistent write/deref in action config processing
Thanks to Tomas Heinrich for alerting us.
2014-07-11 12:46:56 +02:00
Rainer Gerhards
6f30d69e10 Merge branch 'v8-stable' 2014-07-11 12:19:50 +02:00