summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-31 06:41:59 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-31 06:41:59 +0000
commitc3460c09e709c4582c871e9c61d6a16abca33411 (patch)
tree5265c6254159c6d5b33d81f0bc4dc088f57e399a
parent4d2140ce0589c5c7ce33683211887468f82292ce (diff)
downloadrsyslog-c3460c09e709c4582c871e9c61d6a16abca33411.tar.gz
rsyslog-c3460c09e709c4582c871e9c61d6a16abca33411.tar.xz
rsyslog-c3460c09e709c4582c871e9c61d6a16abca33411.zip
bugfix: tcp receiver could segfault due to uninitialized variable
-rw-r--r--ChangeLog1
-rw-r--r--tcpsrv.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 925feaa3..bfe7f406 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ Version 3.12.6 (rgerhards), 2008-04-??
as the modules were otherwise correctly deinitialized and dlopen()
supports multiple opens of the same module without any memory footprint.
- removed --enable-mudflap, added --enable-valgrind ./configure setting
+- bugfix: tcp receiver could segfault due to uninitialized variable
---------------------------------------------------------------------------
Version 3.12.5 (rgerhards), 2008-03-28
- changed default for "last message repeated n times", which is now
diff --git a/tcpsrv.c b/tcpsrv.c
index 165cbc69..adbe26e0 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -434,7 +434,7 @@ static int *create_tcp_socket(tcpsrv_t *pThis)
* If it does not succeed, no session is created and ppSess is
* undefined. If the user has provided an OnSessAccept Callback,
* this one is executed immediately after creation of the
- * session object, so that it can do its own initializatin.
+ * session object, so that it can do its own initialization.
* rgerhards, 2008-03-02
*/
static rsRetVal
@@ -490,7 +490,9 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, int fd)
* configured to do this).
* rgerhards, 2005-09-26
*/
- if(!pThis->pIsPermittedHost((struct sockaddr*) &addr, (char*) fromHostFQDN, pThis->pUsr, (*ppSess)->pUsr)) {
+RUNLOG_VAR("%p", ppSess);
+RUNLOG_VAR("%p", pSess);
+ if(!pThis->pIsPermittedHost((struct sockaddr*) &addr, (char*) fromHostFQDN, pThis->pUsr, pSess->pUsr)) {
dbgprintf("%s is not an allowed sender\n", (char *) fromHostFQDN);
if(option_DisallowWarning) {
errno = 0;
@@ -596,6 +598,7 @@ Run(tcpsrv_t *pThis)
for (i = 0; i < *pThis->pSocksLstn; i++) {
if (FD_ISSET(pThis->pSocksLstn[i+1], &readfds)) {
dbgprintf("New connect on TCP inetd socket: #%d\n", pThis->pSocksLstn[i+1]);
+RUNLOG_VAR("%p", &pNewSess);
SessAccept(pThis, &pNewSess, pThis->pSocksLstn[i+1]);
--nfds; /* indicate we have processed one */
}