diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-03-31 06:41:59 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-03-31 06:41:59 +0000 |
commit | c3460c09e709c4582c871e9c61d6a16abca33411 (patch) | |
tree | 5265c6254159c6d5b33d81f0bc4dc088f57e399a /tcpsrv.c | |
parent | 4d2140ce0589c5c7ce33683211887468f82292ce (diff) | |
download | rsyslog-c3460c09e709c4582c871e9c61d6a16abca33411.tar.gz rsyslog-c3460c09e709c4582c871e9c61d6a16abca33411.tar.xz rsyslog-c3460c09e709c4582c871e9c61d6a16abca33411.zip |
bugfix: tcp receiver could segfault due to uninitialized variable
Diffstat (limited to 'tcpsrv.c')
-rw-r--r-- | tcpsrv.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 */ } |